From ff61a333c7972ad3fce9ff7b84037fdc68cfc6b1 Mon Sep 17 00:00:00 2001 From: Kedar Khaire Date: Mon, 15 Jul 2024 12:42:42 +0530 Subject: [PATCH 1/5] Added Environment support for ApigeeX ApiProduct --- src/Api/ApigeeX/Entity/ApiProduct.php | 2 ++ src/Api/ApigeeX/Entity/ApiProductInterface.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/Api/ApigeeX/Entity/ApiProduct.php b/src/Api/ApigeeX/Entity/ApiProduct.php index 42fbee47..e403298f 100755 --- a/src/Api/ApigeeX/Entity/ApiProduct.php +++ b/src/Api/ApigeeX/Entity/ApiProduct.php @@ -21,11 +21,13 @@ use Apigee\Edge\Api\Monetization\Entity\Entity; use Apigee\Edge\Entity\Property\DescriptionPropertyAwareTrait; use Apigee\Edge\Entity\Property\DisplayNamePropertyAwareTrait; +use Apigee\Edge\Entity\Property\EnvironmentsPropertyAwareTrait; use Apigee\Edge\Entity\Property\NamePropertyAwareTrait; class ApiProduct extends Entity implements ApiProductInterface { use DescriptionPropertyAwareTrait; use DisplayNamePropertyAwareTrait; + use EnvironmentsPropertyAwareTrait; use NamePropertyAwareTrait; } diff --git a/src/Api/ApigeeX/Entity/ApiProductInterface.php b/src/Api/ApigeeX/Entity/ApiProductInterface.php index beb82a8b..fa5e23e2 100755 --- a/src/Api/ApigeeX/Entity/ApiProductInterface.php +++ b/src/Api/ApigeeX/Entity/ApiProductInterface.php @@ -20,11 +20,13 @@ use Apigee\Edge\Entity\Property\DescriptionPropertyInterface; use Apigee\Edge\Entity\Property\DisplayNamePropertyInterface; +use Apigee\Edge\Entity\Property\EnvironmentsPropertyInterface; use Apigee\Edge\Entity\Property\NamePropertyInterface; interface ApiProductInterface extends DescriptionPropertyInterface, DisplayNamePropertyInterface, + EnvironmentsPropertyInterface, NamePropertyInterface { } From d4924480544d8604c03c6b606c4cdbeb99f237d7 Mon Sep 17 00:00:00 2001 From: Kedar Khaire Date: Wed, 24 Jul 2024 20:16:42 +0530 Subject: [PATCH 2/5] Support of AttributesProperty is added --- src/Api/ApigeeX/Entity/ApiProduct.php | 2 ++ src/Api/ApigeeX/Entity/ApiProductInterface.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/Api/ApigeeX/Entity/ApiProduct.php b/src/Api/ApigeeX/Entity/ApiProduct.php index e403298f..3a9f36cb 100755 --- a/src/Api/ApigeeX/Entity/ApiProduct.php +++ b/src/Api/ApigeeX/Entity/ApiProduct.php @@ -19,6 +19,7 @@ namespace Apigee\Edge\Api\ApigeeX\Entity; use Apigee\Edge\Api\Monetization\Entity\Entity; +use Apigee\Edge\Entity\Property\AttributesPropertyAwareTrait; use Apigee\Edge\Entity\Property\DescriptionPropertyAwareTrait; use Apigee\Edge\Entity\Property\DisplayNamePropertyAwareTrait; use Apigee\Edge\Entity\Property\EnvironmentsPropertyAwareTrait; @@ -26,6 +27,7 @@ class ApiProduct extends Entity implements ApiProductInterface { + use AttributesPropertyAwareTrait; use DescriptionPropertyAwareTrait; use DisplayNamePropertyAwareTrait; use EnvironmentsPropertyAwareTrait; diff --git a/src/Api/ApigeeX/Entity/ApiProductInterface.php b/src/Api/ApigeeX/Entity/ApiProductInterface.php index fa5e23e2..819d4519 100755 --- a/src/Api/ApigeeX/Entity/ApiProductInterface.php +++ b/src/Api/ApigeeX/Entity/ApiProductInterface.php @@ -18,12 +18,14 @@ namespace Apigee\Edge\Api\ApigeeX\Entity; +use Apigee\Edge\Entity\Property\AttributesPropertyInterface; use Apigee\Edge\Entity\Property\DescriptionPropertyInterface; use Apigee\Edge\Entity\Property\DisplayNamePropertyInterface; use Apigee\Edge\Entity\Property\EnvironmentsPropertyInterface; use Apigee\Edge\Entity\Property\NamePropertyInterface; interface ApiProductInterface extends + AttributesPropertyInterface, DescriptionPropertyInterface, DisplayNamePropertyInterface, EnvironmentsPropertyInterface, From fb8858184b4971574ffba1f02194054c5f2e86af Mon Sep 17 00:00:00 2001 From: Kedar Khaire Date: Wed, 24 Jul 2024 21:47:37 +0530 Subject: [PATCH 3/5] Changes for testcase errors --- src/Entity/Property/AttributesPropertyAwareTrait.php | 2 +- src/Entity/Property/AttributesPropertyInterface.php | 2 +- src/Entity/Property/EnvironmentsPropertyAwareTrait.php | 2 +- src/Entity/Property/EnvironmentsPropertyInterface.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Entity/Property/AttributesPropertyAwareTrait.php b/src/Entity/Property/AttributesPropertyAwareTrait.php index e7f8214e..5b29ee8b 100644 --- a/src/Entity/Property/AttributesPropertyAwareTrait.php +++ b/src/Entity/Property/AttributesPropertyAwareTrait.php @@ -33,7 +33,7 @@ trait AttributesPropertyAwareTrait /** * {@inheritdoc} */ - public function getAttributes(): AttributesProperty + public function getAttributes(): ?AttributesProperty { return $this->attributes; } diff --git a/src/Entity/Property/AttributesPropertyInterface.php b/src/Entity/Property/AttributesPropertyInterface.php index 67f5d121..7191aac9 100644 --- a/src/Entity/Property/AttributesPropertyInterface.php +++ b/src/Entity/Property/AttributesPropertyInterface.php @@ -30,7 +30,7 @@ interface AttributesPropertyInterface /** * @return \Apigee\Edge\Structure\AttributesProperty */ - public function getAttributes(): AttributesProperty; + public function getAttributes(): ?AttributesProperty; /** * @param \Apigee\Edge\Structure\AttributesProperty $attributes diff --git a/src/Entity/Property/EnvironmentsPropertyAwareTrait.php b/src/Entity/Property/EnvironmentsPropertyAwareTrait.php index 22eb7103..1fd64d23 100644 --- a/src/Entity/Property/EnvironmentsPropertyAwareTrait.php +++ b/src/Entity/Property/EnvironmentsPropertyAwareTrait.php @@ -31,7 +31,7 @@ trait EnvironmentsPropertyAwareTrait * * @return string[] */ - public function getEnvironments(): array + public function getEnvironments(): ?array { return $this->environments; } diff --git a/src/Entity/Property/EnvironmentsPropertyInterface.php b/src/Entity/Property/EnvironmentsPropertyInterface.php index 176723c3..4b728000 100644 --- a/src/Entity/Property/EnvironmentsPropertyInterface.php +++ b/src/Entity/Property/EnvironmentsPropertyInterface.php @@ -26,7 +26,7 @@ interface EnvironmentsPropertyInterface /** * @return string[] */ - public function getEnvironments(): array; + public function getEnvironments(): ?array; /** * @param string ...$environments From b4dbe23d091f8b9069fa486499c49cfafea954fb Mon Sep 17 00:00:00 2001 From: Kedar Khaire Date: Wed, 24 Jul 2024 21:51:54 +0530 Subject: [PATCH 4/5] Changes for testcase errors --- src/Entity/Property/EnvironmentsPropertyAwareTrait.php | 2 +- src/Entity/Property/EnvironmentsPropertyInterface.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Entity/Property/EnvironmentsPropertyAwareTrait.php b/src/Entity/Property/EnvironmentsPropertyAwareTrait.php index 1fd64d23..22eb7103 100644 --- a/src/Entity/Property/EnvironmentsPropertyAwareTrait.php +++ b/src/Entity/Property/EnvironmentsPropertyAwareTrait.php @@ -31,7 +31,7 @@ trait EnvironmentsPropertyAwareTrait * * @return string[] */ - public function getEnvironments(): ?array + public function getEnvironments(): array { return $this->environments; } diff --git a/src/Entity/Property/EnvironmentsPropertyInterface.php b/src/Entity/Property/EnvironmentsPropertyInterface.php index 4b728000..176723c3 100644 --- a/src/Entity/Property/EnvironmentsPropertyInterface.php +++ b/src/Entity/Property/EnvironmentsPropertyInterface.php @@ -26,7 +26,7 @@ interface EnvironmentsPropertyInterface /** * @return string[] */ - public function getEnvironments(): ?array; + public function getEnvironments(): array; /** * @param string ...$environments From 385b355f90e7c43b86572bd53f58945fbf34871b Mon Sep 17 00:00:00 2001 From: Kedar Khaire Date: Thu, 25 Jul 2024 15:06:53 +0530 Subject: [PATCH 5/5] Removed support of AttributesProperty to ApiProduct --- src/Api/ApigeeX/Entity/ApiProduct.php | 2 -- src/Api/ApigeeX/Entity/ApiProductInterface.php | 2 -- src/Entity/Property/AttributesPropertyAwareTrait.php | 2 +- src/Entity/Property/AttributesPropertyInterface.php | 2 +- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Api/ApigeeX/Entity/ApiProduct.php b/src/Api/ApigeeX/Entity/ApiProduct.php index 3a9f36cb..e403298f 100755 --- a/src/Api/ApigeeX/Entity/ApiProduct.php +++ b/src/Api/ApigeeX/Entity/ApiProduct.php @@ -19,7 +19,6 @@ namespace Apigee\Edge\Api\ApigeeX\Entity; use Apigee\Edge\Api\Monetization\Entity\Entity; -use Apigee\Edge\Entity\Property\AttributesPropertyAwareTrait; use Apigee\Edge\Entity\Property\DescriptionPropertyAwareTrait; use Apigee\Edge\Entity\Property\DisplayNamePropertyAwareTrait; use Apigee\Edge\Entity\Property\EnvironmentsPropertyAwareTrait; @@ -27,7 +26,6 @@ class ApiProduct extends Entity implements ApiProductInterface { - use AttributesPropertyAwareTrait; use DescriptionPropertyAwareTrait; use DisplayNamePropertyAwareTrait; use EnvironmentsPropertyAwareTrait; diff --git a/src/Api/ApigeeX/Entity/ApiProductInterface.php b/src/Api/ApigeeX/Entity/ApiProductInterface.php index 819d4519..fa5e23e2 100755 --- a/src/Api/ApigeeX/Entity/ApiProductInterface.php +++ b/src/Api/ApigeeX/Entity/ApiProductInterface.php @@ -18,14 +18,12 @@ namespace Apigee\Edge\Api\ApigeeX\Entity; -use Apigee\Edge\Entity\Property\AttributesPropertyInterface; use Apigee\Edge\Entity\Property\DescriptionPropertyInterface; use Apigee\Edge\Entity\Property\DisplayNamePropertyInterface; use Apigee\Edge\Entity\Property\EnvironmentsPropertyInterface; use Apigee\Edge\Entity\Property\NamePropertyInterface; interface ApiProductInterface extends - AttributesPropertyInterface, DescriptionPropertyInterface, DisplayNamePropertyInterface, EnvironmentsPropertyInterface, diff --git a/src/Entity/Property/AttributesPropertyAwareTrait.php b/src/Entity/Property/AttributesPropertyAwareTrait.php index 5b29ee8b..e7f8214e 100644 --- a/src/Entity/Property/AttributesPropertyAwareTrait.php +++ b/src/Entity/Property/AttributesPropertyAwareTrait.php @@ -33,7 +33,7 @@ trait AttributesPropertyAwareTrait /** * {@inheritdoc} */ - public function getAttributes(): ?AttributesProperty + public function getAttributes(): AttributesProperty { return $this->attributes; } diff --git a/src/Entity/Property/AttributesPropertyInterface.php b/src/Entity/Property/AttributesPropertyInterface.php index 7191aac9..67f5d121 100644 --- a/src/Entity/Property/AttributesPropertyInterface.php +++ b/src/Entity/Property/AttributesPropertyInterface.php @@ -30,7 +30,7 @@ interface AttributesPropertyInterface /** * @return \Apigee\Edge\Structure\AttributesProperty */ - public function getAttributes(): ?AttributesProperty; + public function getAttributes(): AttributesProperty; /** * @param \Apigee\Edge\Structure\AttributesProperty $attributes