diff --git a/src/Client/Api/EventsApi.php b/src/Client/Api/EventsApi.php index 19d8c09..00883c1 100644 --- a/src/Client/Api/EventsApi.php +++ b/src/Client/Api/EventsApi.php @@ -1149,7 +1149,7 @@ public function countAffectedEventsRequest($project_id, $body = null, $direction * * @throws \Convoy\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Convoy\Client\Model\CreateBroadcastEvent201Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response + * @return \Convoy\Client\Model\CreateEndpointEvent201Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response */ public function createBroadcastEvent($project_id, $models_broadcast_event, string $contentType = self::contentTypes['createBroadcastEvent'][0]) { @@ -1168,7 +1168,7 @@ public function createBroadcastEvent($project_id, $models_broadcast_event, strin * * @throws \Convoy\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Convoy\Client\Model\CreateBroadcastEvent201Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \Convoy\Client\Model\CreateEndpointEvent201Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response, HTTP status code, HTTP response headers (array of strings) */ public function createBroadcastEventWithHttpInfo($project_id, $models_broadcast_event, string $contentType = self::contentTypes['createBroadcastEvent'][0]) { @@ -1200,7 +1200,7 @@ public function createBroadcastEventWithHttpInfo($project_id, $models_broadcast_ switch($statusCode) { case 201: return $this->handleResponseWithDataType( - '\Convoy\Client\Model\CreateBroadcastEvent201Response', + '\Convoy\Client\Model\CreateEndpointEvent201Response', $request, $response, ); @@ -1240,7 +1240,7 @@ public function createBroadcastEventWithHttpInfo($project_id, $models_broadcast_ } return $this->handleResponseWithDataType( - '\Convoy\Client\Model\CreateBroadcastEvent201Response', + '\Convoy\Client\Model\CreateEndpointEvent201Response', $request, $response, ); @@ -1249,7 +1249,7 @@ public function createBroadcastEventWithHttpInfo($project_id, $models_broadcast_ case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Convoy\Client\Model\CreateBroadcastEvent201Response', + '\Convoy\Client\Model\CreateEndpointEvent201Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1321,7 +1321,7 @@ function ($response) { */ public function createBroadcastEventAsyncWithHttpInfo($project_id, $models_broadcast_event, string $contentType = self::contentTypes['createBroadcastEvent'][0]) { - $returnType = '\Convoy\Client\Model\CreateBroadcastEvent201Response'; + $returnType = '\Convoy\Client\Model\CreateEndpointEvent201Response'; $request = $this->createBroadcastEventRequest($project_id, $models_broadcast_event, $contentType); return $this->client @@ -1482,7 +1482,7 @@ public function createBroadcastEventRequest($project_id, $models_broadcast_event * * @throws \Convoy\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response + * @return \Convoy\Client\Model\CreateEndpointEvent201Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response */ public function createDynamicEvent($project_id, $models_dynamic_event, string $contentType = self::contentTypes['createDynamicEvent'][0]) { @@ -1501,7 +1501,7 @@ public function createDynamicEvent($project_id, $models_dynamic_event, string $c * * @throws \Convoy\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \Convoy\Client\Model\CreateEndpointEvent201Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response, HTTP status code, HTTP response headers (array of strings) */ public function createDynamicEventWithHttpInfo($project_id, $models_dynamic_event, string $contentType = self::contentTypes['createDynamicEvent'][0]) { @@ -1533,7 +1533,7 @@ public function createDynamicEventWithHttpInfo($project_id, $models_dynamic_even switch($statusCode) { case 201: return $this->handleResponseWithDataType( - '\Convoy\Client\Model\GetProjects400Response', + '\Convoy\Client\Model\CreateEndpointEvent201Response', $request, $response, ); @@ -1573,7 +1573,7 @@ public function createDynamicEventWithHttpInfo($project_id, $models_dynamic_even } return $this->handleResponseWithDataType( - '\Convoy\Client\Model\GetProjects400Response', + '\Convoy\Client\Model\CreateEndpointEvent201Response', $request, $response, ); @@ -1582,7 +1582,7 @@ public function createDynamicEventWithHttpInfo($project_id, $models_dynamic_even case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Convoy\Client\Model\GetProjects400Response', + '\Convoy\Client\Model\CreateEndpointEvent201Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1654,7 +1654,7 @@ function ($response) { */ public function createDynamicEventAsyncWithHttpInfo($project_id, $models_dynamic_event, string $contentType = self::contentTypes['createDynamicEvent'][0]) { - $returnType = '\Convoy\Client\Model\GetProjects400Response'; + $returnType = '\Convoy\Client\Model\CreateEndpointEvent201Response'; $request = $this->createDynamicEventRequest($project_id, $models_dynamic_event, $contentType); return $this->client @@ -1815,7 +1815,7 @@ public function createDynamicEventRequest($project_id, $models_dynamic_event, st * * @throws \Convoy\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response + * @return \Convoy\Client\Model\CreateEndpointEvent201Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response */ public function createEndpointEvent($project_id, $models_create_event, string $contentType = self::contentTypes['createEndpointEvent'][0]) { @@ -1834,7 +1834,7 @@ public function createEndpointEvent($project_id, $models_create_event, string $c * * @throws \Convoy\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \Convoy\Client\Model\CreateEndpointEvent201Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response, HTTP status code, HTTP response headers (array of strings) */ public function createEndpointEventWithHttpInfo($project_id, $models_create_event, string $contentType = self::contentTypes['createEndpointEvent'][0]) { @@ -1866,7 +1866,7 @@ public function createEndpointEventWithHttpInfo($project_id, $models_create_even switch($statusCode) { case 201: return $this->handleResponseWithDataType( - '\Convoy\Client\Model\GetProjects400Response', + '\Convoy\Client\Model\CreateEndpointEvent201Response', $request, $response, ); @@ -1906,7 +1906,7 @@ public function createEndpointEventWithHttpInfo($project_id, $models_create_even } return $this->handleResponseWithDataType( - '\Convoy\Client\Model\GetProjects400Response', + '\Convoy\Client\Model\CreateEndpointEvent201Response', $request, $response, ); @@ -1915,7 +1915,7 @@ public function createEndpointEventWithHttpInfo($project_id, $models_create_even case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Convoy\Client\Model\GetProjects400Response', + '\Convoy\Client\Model\CreateEndpointEvent201Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1987,7 +1987,7 @@ function ($response) { */ public function createEndpointEventAsyncWithHttpInfo($project_id, $models_create_event, string $contentType = self::contentTypes['createEndpointEvent'][0]) { - $returnType = '\Convoy\Client\Model\GetProjects400Response'; + $returnType = '\Convoy\Client\Model\CreateEndpointEvent201Response'; $request = $this->createEndpointEventRequest($project_id, $models_create_event, $contentType); return $this->client @@ -2148,7 +2148,7 @@ public function createEndpointEventRequest($project_id, $models_create_event, st * * @throws \Convoy\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response + * @return \Convoy\Client\Model\CreateEndpointEvent201Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response */ public function createEndpointFanoutEvent($project_id, $models_fanout_event, string $contentType = self::contentTypes['createEndpointFanoutEvent'][0]) { @@ -2167,7 +2167,7 @@ public function createEndpointFanoutEvent($project_id, $models_fanout_event, str * * @throws \Convoy\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \Convoy\Client\Model\CreateEndpointEvent201Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response, HTTP status code, HTTP response headers (array of strings) */ public function createEndpointFanoutEventWithHttpInfo($project_id, $models_fanout_event, string $contentType = self::contentTypes['createEndpointFanoutEvent'][0]) { @@ -2199,7 +2199,7 @@ public function createEndpointFanoutEventWithHttpInfo($project_id, $models_fanou switch($statusCode) { case 201: return $this->handleResponseWithDataType( - '\Convoy\Client\Model\GetProjects400Response', + '\Convoy\Client\Model\CreateEndpointEvent201Response', $request, $response, ); @@ -2239,7 +2239,7 @@ public function createEndpointFanoutEventWithHttpInfo($project_id, $models_fanou } return $this->handleResponseWithDataType( - '\Convoy\Client\Model\GetProjects400Response', + '\Convoy\Client\Model\CreateEndpointEvent201Response', $request, $response, ); @@ -2248,7 +2248,7 @@ public function createEndpointFanoutEventWithHttpInfo($project_id, $models_fanou case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Convoy\Client\Model\GetProjects400Response', + '\Convoy\Client\Model\CreateEndpointEvent201Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2320,7 +2320,7 @@ function ($response) { */ public function createEndpointFanoutEventAsyncWithHttpInfo($project_id, $models_fanout_event, string $contentType = self::contentTypes['createEndpointFanoutEvent'][0]) { - $returnType = '\Convoy\Client\Model\GetProjects400Response'; + $returnType = '\Convoy\Client\Model\CreateEndpointEvent201Response'; $request = $this->createEndpointFanoutEventRequest($project_id, $models_fanout_event, $contentType); return $this->client @@ -2481,7 +2481,7 @@ public function createEndpointFanoutEventRequest($project_id, $models_fanout_eve * * @throws \Convoy\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Convoy\Client\Model\CreateBroadcastEvent201Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response + * @return \Convoy\Client\Model\GetEndpointEvent200Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response */ public function getEndpointEvent($project_id, $event_id, string $contentType = self::contentTypes['getEndpointEvent'][0]) { @@ -2500,7 +2500,7 @@ public function getEndpointEvent($project_id, $event_id, string $contentType = s * * @throws \Convoy\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Convoy\Client\Model\CreateBroadcastEvent201Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \Convoy\Client\Model\GetEndpointEvent200Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response, HTTP status code, HTTP response headers (array of strings) */ public function getEndpointEventWithHttpInfo($project_id, $event_id, string $contentType = self::contentTypes['getEndpointEvent'][0]) { @@ -2532,7 +2532,7 @@ public function getEndpointEventWithHttpInfo($project_id, $event_id, string $con switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\Convoy\Client\Model\CreateBroadcastEvent201Response', + '\Convoy\Client\Model\GetEndpointEvent200Response', $request, $response, ); @@ -2572,7 +2572,7 @@ public function getEndpointEventWithHttpInfo($project_id, $event_id, string $con } return $this->handleResponseWithDataType( - '\Convoy\Client\Model\CreateBroadcastEvent201Response', + '\Convoy\Client\Model\GetEndpointEvent200Response', $request, $response, ); @@ -2581,7 +2581,7 @@ public function getEndpointEventWithHttpInfo($project_id, $event_id, string $con case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Convoy\Client\Model\CreateBroadcastEvent201Response', + '\Convoy\Client\Model\GetEndpointEvent200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2653,7 +2653,7 @@ function ($response) { */ public function getEndpointEventAsyncWithHttpInfo($project_id, $event_id, string $contentType = self::contentTypes['getEndpointEvent'][0]) { - $returnType = '\Convoy\Client\Model\CreateBroadcastEvent201Response'; + $returnType = '\Convoy\Client\Model\GetEndpointEvent200Response'; $request = $this->getEndpointEventRequest($project_id, $event_id, $contentType); return $this->client @@ -3337,7 +3337,7 @@ public function getEventsPagedRequest($project_id, $body = null, $direction = nu * * @throws \Convoy\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Convoy\Client\Model\CreateBroadcastEvent201Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response + * @return \Convoy\Client\Model\GetEndpointEvent200Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response */ public function replayEndpointEvent($project_id, $event_id, string $contentType = self::contentTypes['replayEndpointEvent'][0]) { @@ -3356,7 +3356,7 @@ public function replayEndpointEvent($project_id, $event_id, string $contentType * * @throws \Convoy\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Convoy\Client\Model\CreateBroadcastEvent201Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \Convoy\Client\Model\GetEndpointEvent200Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response|\Convoy\Client\Model\GetProjects400Response, HTTP status code, HTTP response headers (array of strings) */ public function replayEndpointEventWithHttpInfo($project_id, $event_id, string $contentType = self::contentTypes['replayEndpointEvent'][0]) { @@ -3388,7 +3388,7 @@ public function replayEndpointEventWithHttpInfo($project_id, $event_id, string $ switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\Convoy\Client\Model\CreateBroadcastEvent201Response', + '\Convoy\Client\Model\GetEndpointEvent200Response', $request, $response, ); @@ -3428,7 +3428,7 @@ public function replayEndpointEventWithHttpInfo($project_id, $event_id, string $ } return $this->handleResponseWithDataType( - '\Convoy\Client\Model\CreateBroadcastEvent201Response', + '\Convoy\Client\Model\GetEndpointEvent200Response', $request, $response, ); @@ -3437,7 +3437,7 @@ public function replayEndpointEventWithHttpInfo($project_id, $event_id, string $ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Convoy\Client\Model\CreateBroadcastEvent201Response', + '\Convoy\Client\Model\GetEndpointEvent200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3509,7 +3509,7 @@ function ($response) { */ public function replayEndpointEventAsyncWithHttpInfo($project_id, $event_id, string $contentType = self::contentTypes['replayEndpointEvent'][0]) { - $returnType = '\Convoy\Client\Model\CreateBroadcastEvent201Response'; + $returnType = '\Convoy\Client\Model\GetEndpointEvent200Response'; $request = $this->replayEndpointEventRequest($project_id, $event_id, $contentType); return $this->client diff --git a/src/Client/Model/CreateEndpointEvent201Response.php b/src/Client/Model/CreateEndpointEvent201Response.php new file mode 100644 index 0000000..b80dafc --- /dev/null +++ b/src/Client/Model/CreateEndpointEvent201Response.php @@ -0,0 +1,478 @@ + + */ +class CreateEndpointEvent201Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateEndpointEvent_201_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'message' => 'string', + 'status' => 'bool', + 'data' => '\Convoy\Client\Model\ModelsEventQueuedResponse' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'message' => null, + 'status' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'message' => false, + 'status' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'message' => 'message', + 'status' => 'status', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + 'status' => 'setStatus', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + 'status' => 'getStatus', + 'data' => 'getData' + ]; + + /** + * 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[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets status + * + * @return bool|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param bool|null $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets data + * + * @return \Convoy\Client\Model\ModelsEventQueuedResponse|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Convoy\Client\Model\ModelsEventQueuedResponse|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * 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/src/Client/Model/CreateBroadcastEvent201Response.php b/src/Client/Model/GetEndpointEvent200Response.php similarity index 97% rename from src/Client/Model/CreateBroadcastEvent201Response.php rename to src/Client/Model/GetEndpointEvent200Response.php index 3f9b688..36c4e3f 100644 --- a/src/Client/Model/CreateBroadcastEvent201Response.php +++ b/src/Client/Model/GetEndpointEvent200Response.php @@ -1,6 +1,6 @@ */ -class CreateBroadcastEvent201Response implements ModelInterface, ArrayAccess, \JsonSerializable +class GetEndpointEvent200Response implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class CreateBroadcastEvent201Response implements ModelInterface, ArrayAccess, \J * * @var string */ - protected static $openAPIModelName = 'CreateBroadcastEvent_201_response'; + protected static $openAPIModelName = 'GetEndpointEvent_200_response'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/src/Client/Model/ModelsEventQueuedResponse.php b/src/Client/Model/ModelsEventQueuedResponse.php new file mode 100644 index 0000000..53e654b --- /dev/null +++ b/src/Client/Model/ModelsEventQueuedResponse.php @@ -0,0 +1,478 @@ + + */ +class ModelsEventQueuedResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'models.EventQueuedResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'event_type' => 'string', + 'idempotency_key' => 'string', + 'uid' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'event_type' => null, + 'idempotency_key' => null, + 'uid' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'event_type' => false, + 'idempotency_key' => false, + 'uid' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'event_type' => 'event_type', + 'idempotency_key' => 'idempotency_key', + 'uid' => 'uid' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'event_type' => 'setEventType', + 'idempotency_key' => 'setIdempotencyKey', + 'uid' => 'setUid' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'event_type' => 'getEventType', + 'idempotency_key' => 'getIdempotencyKey', + 'uid' => 'getUid' + ]; + + /** + * 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[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('event_type', $data ?? [], null); + $this->setIfExists('idempotency_key', $data ?? [], null); + $this->setIfExists('uid', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 event_type + * + * @return string|null + */ + public function getEventType() + { + return $this->container['event_type']; + } + + /** + * Sets event_type + * + * @param string|null $event_type event_type + * + * @return self + */ + public function setEventType($event_type) + { + if (is_null($event_type)) { + throw new \InvalidArgumentException('non-nullable event_type cannot be null'); + } + $this->container['event_type'] = $event_type; + + return $this; + } + + /** + * Gets idempotency_key + * + * @return string|null + */ + public function getIdempotencyKey() + { + return $this->container['idempotency_key']; + } + + /** + * Sets idempotency_key + * + * @param string|null $idempotency_key idempotency_key + * + * @return self + */ + public function setIdempotencyKey($idempotency_key) + { + if (is_null($idempotency_key)) { + throw new \InvalidArgumentException('non-nullable idempotency_key cannot be null'); + } + $this->container['idempotency_key'] = $idempotency_key; + + return $this; + } + + /** + * Gets uid + * + * @return string|null + */ + public function getUid() + { + return $this->container['uid']; + } + + /** + * Sets uid + * + * @param string|null $uid UID is the event id. + * + * @return self + */ + public function setUid($uid) + { + if (is_null($uid)) { + throw new \InvalidArgumentException('non-nullable uid cannot be null'); + } + $this->container['uid'] = $uid; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * 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)); + } +} + +