-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added runtimeType and monetizationConfig property to check monetizati…
…on status in Apigee X (#145)
- Loading branch information
Showing
6 changed files
with
210 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright 2021 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
namespace Apigee\Edge\Entity\Property; | ||
|
||
/** | ||
* Trait RuntimeTypeAwareTrait. | ||
* | ||
* @see \Apigee\Edge\Entity\Property\RuntimeTypeInterface | ||
*/ | ||
trait RuntimeTypeAwareTrait | ||
{ | ||
/** @var string|null */ | ||
protected $runtimeType; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getRuntimeType(): ?string | ||
{ | ||
return $this->runtimeType; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function setRuntimeType(string $runtimeType): void | ||
{ | ||
$this->runtimeType = $runtimeType; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright 2021 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
namespace Apigee\Edge\Entity\Property; | ||
|
||
/** | ||
* Interface RuntimeTypeInterface. | ||
*/ | ||
interface RuntimeTypeInterface | ||
{ | ||
/** | ||
* @return string | ||
*/ | ||
public function getRuntimeType(): ?string; | ||
|
||
/** | ||
* @param string $runtimeType | ||
*/ | ||
public function setRuntimeType(string $runtimeType): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright 2021 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
namespace Apigee\Edge\Structure; | ||
|
||
/** | ||
* Class AddonsConfig. | ||
*/ | ||
final class AddonsConfig extends BaseObject | ||
{ | ||
/** @var \Apigee\Edge\Structure\MonetizationConfig */ | ||
protected $monetizationConfig; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getMonetizationConfig(): ?MonetizationConfig | ||
{ | ||
return $this->monetizationConfig; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function setMonetizationConfig(MonetizationConfig $monetizationConfig): void | ||
{ | ||
$this->monetizationConfig = $monetizationConfig; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright 2021 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
namespace Apigee\Edge\Structure; | ||
|
||
/** | ||
* Class MonetizationConfig. | ||
*/ | ||
final class MonetizationConfig extends BaseObject | ||
{ | ||
/** @var bool */ | ||
protected $enabled; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getEnabled(): ?bool | ||
{ | ||
return $this->enabled; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function setEnabled(bool $enabled): void | ||
{ | ||
$this->enabled = $enabled; | ||
} | ||
} |
906b132
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@phdhiren @cnovak I see that newly added ApigeeX related codes do not have test coverage therefore they reduce the accumulated test coverage of this library. Can we start requiring test coverage for every new change before they get merged?
906b132
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mxr576, hope all is well with you.
Yes, as Chris mentioned on the other issue yesterday, we're going to add test coverage for the existing code, and make it a practice to add test cases for code changes along with submitted PRs going forward. Thank you for your positive feedback all along.
906b132
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
Yes, I know that was for the Apigee Edge module and this the PHP API client which had much better test coverage even in the early days, that is the reason why I try to call attention to this. It is much easier to test the code in PHP API client than a Drupal module.
Thanks for the quick reply, I hope you are well too.