From c4a4ebedb039071cc43bd389cdadd504f7059bc8 Mon Sep 17 00:00:00 2001 From: Phrase Date: Fri, 19 Apr 2024 13:33:31 +0000 Subject: [PATCH] Deploying from phrase/openapi@2c6f4325 --- .openapi-generator/FILES | 3 + README.md | 1 + docs/Model/TranslationDetails.md | 1 + docs/Model/TranslationParent.md | 12 + lib/Model/TranslationDetails.php | 40 ++- lib/Model/TranslationParent.php | 339 ++++++++++++++++++++++++++ test/Model/TranslationDetailsTest.php | 7 + test/Model/TranslationParentTest.php | 92 +++++++ 8 files changed, 490 insertions(+), 5 deletions(-) create mode 100644 docs/Model/TranslationParent.md create mode 100644 lib/Model/TranslationParent.php create mode 100644 test/Model/TranslationParentTest.php diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index a930031..cfafdc7 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -252,6 +252,7 @@ docs/Model/TranslationIncludeParameters.md docs/Model/TranslationKey.md docs/Model/TranslationKeyDetails.md docs/Model/TranslationOrder.md +docs/Model/TranslationParent.md docs/Model/TranslationReviewParameters.md docs/Model/TranslationUnverifyParameters.md docs/Model/TranslationUpdateParameters.md @@ -528,6 +529,7 @@ lib/Model/TranslationIncludeParameters.php lib/Model/TranslationKey.php lib/Model/TranslationKeyDetails.php lib/Model/TranslationOrder.php +lib/Model/TranslationParent.php lib/Model/TranslationReviewParameters.php lib/Model/TranslationUnverifyParameters.php lib/Model/TranslationUpdateParameters.php @@ -798,6 +800,7 @@ test/Model/TranslationIncludeParametersTest.php test/Model/TranslationKeyDetailsTest.php test/Model/TranslationKeyTest.php test/Model/TranslationOrderTest.php +test/Model/TranslationParentTest.php test/Model/TranslationReviewParametersTest.php test/Model/TranslationTest.php test/Model/TranslationUnverifyParametersTest.php diff --git a/README.md b/README.md index badc67d..ecba7a3 100644 --- a/README.md +++ b/README.md @@ -616,6 +616,7 @@ Class | Method | HTTP request | Description - [TranslationKey](docs/Model/TranslationKey.md) - [TranslationKeyDetails](docs/Model/TranslationKeyDetails.md) - [TranslationOrder](docs/Model/TranslationOrder.md) + - [TranslationParent](docs/Model/TranslationParent.md) - [TranslationReviewParameters](docs/Model/TranslationReviewParameters.md) - [TranslationUnverifyParameters](docs/Model/TranslationUnverifyParameters.md) - [TranslationUpdateParameters](docs/Model/TranslationUpdateParameters.md) diff --git a/docs/Model/TranslationDetails.md b/docs/Model/TranslationDetails.md index 4d53093..7d70470 100644 --- a/docs/Model/TranslationDetails.md +++ b/docs/Model/TranslationDetails.md @@ -17,6 +17,7 @@ Name | Type | Description | Notes **updated_at** | **\DateTime** | | [optional] **user** | [**\Phrase\Model\UserPreview**](UserPreview.md) | | [optional] **word_count** | **int** | | [optional] +**linked_translation** | [**\Phrase\Model\TranslationParent**](TranslationParent.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TranslationParent.md b/docs/Model/TranslationParent.md new file mode 100644 index 0000000..db56bd7 --- /dev/null +++ b/docs/Model/TranslationParent.md @@ -0,0 +1,12 @@ +# # TranslationParent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**content** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/lib/Model/TranslationDetails.php b/lib/Model/TranslationDetails.php index 4574094..673d65b 100644 --- a/lib/Model/TranslationDetails.php +++ b/lib/Model/TranslationDetails.php @@ -67,7 +67,8 @@ class TranslationDetails implements ModelInterface, ArrayAccess 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'user' => '\Phrase\Model\UserPreview', - 'word_count' => 'int' + 'word_count' => 'int', + 'linked_translation' => '\Phrase\Model\TranslationParent' ]; /** @@ -88,7 +89,8 @@ class TranslationDetails implements ModelInterface, ArrayAccess 'created_at' => 'date-time', 'updated_at' => 'date-time', 'user' => null, - 'word_count' => null + 'word_count' => null, + 'linked_translation' => null ]; /** @@ -130,7 +132,8 @@ public static function openAPIFormats() 'created_at' => 'created_at', 'updated_at' => 'updated_at', 'user' => 'user', - 'word_count' => 'word_count' + 'word_count' => 'word_count', + 'linked_translation' => 'linked_translation' ]; /** @@ -151,7 +154,8 @@ public static function openAPIFormats() 'created_at' => 'setCreatedAt', 'updated_at' => 'setUpdatedAt', 'user' => 'setUser', - 'word_count' => 'setWordCount' + 'word_count' => 'setWordCount', + 'linked_translation' => 'setLinkedTranslation' ]; /** @@ -172,7 +176,8 @@ public static function openAPIFormats() 'created_at' => 'getCreatedAt', 'updated_at' => 'getUpdatedAt', 'user' => 'getUser', - 'word_count' => 'getWordCount' + 'word_count' => 'getWordCount', + 'linked_translation' => 'getLinkedTranslation' ]; /** @@ -248,6 +253,7 @@ public function __construct(array $data = null) $this->container['updated_at'] = isset($data['updated_at']) ? $data['updated_at'] : null; $this->container['user'] = isset($data['user']) ? $data['user'] : null; $this->container['word_count'] = isset($data['word_count']) ? $data['word_count'] : null; + $this->container['linked_translation'] = isset($data['linked_translation']) ? $data['linked_translation'] : null; } /** @@ -585,6 +591,30 @@ public function setWordCount($word_count) return $this; } + + /** + * Gets linked_translation + * + * @return \Phrase\Model\TranslationParent|null + */ + public function getLinkedTranslation() + { + return $this->container['linked_translation']; + } + + /** + * Sets linked_translation + * + * @param \Phrase\Model\TranslationParent|null $linked_translation linked_translation + * + * @return $this + */ + public function setLinkedTranslation($linked_translation) + { + $this->container['linked_translation'] = $linked_translation; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/TranslationParent.php b/lib/Model/TranslationParent.php new file mode 100644 index 0000000..cc82132 --- /dev/null +++ b/lib/Model/TranslationParent.php @@ -0,0 +1,339 @@ + 'string', + 'content' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'content' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'content' => 'content' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'content' => 'setContent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'content' => 'getContent' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['content'] = isset($data['content']) ? $data['content'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content content + * + * @return $this + */ + public function setContent($content) + { + $this->container['content'] = $content; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/test/Model/TranslationDetailsTest.php b/test/Model/TranslationDetailsTest.php index 93e1cf2..84da788 100644 --- a/test/Model/TranslationDetailsTest.php +++ b/test/Model/TranslationDetailsTest.php @@ -166,4 +166,11 @@ public function testPropertyUser() public function testPropertyWordCount() { } + + /** + * Test attribute "linked_translation" + */ + public function testPropertyLinkedTranslation() + { + } } diff --git a/test/Model/TranslationParentTest.php b/test/Model/TranslationParentTest.php new file mode 100644 index 0000000..fd1f4c9 --- /dev/null +++ b/test/Model/TranslationParentTest.php @@ -0,0 +1,92 @@ +