PageRenderTime 43ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/htdocs/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetWebhook.php

https://gitlab.com/VTTE/sitios-vtte
PHP | 534 lines | 392 code | 26 blank | 116 comment | 4 complexity | 67875c3d6c3f99af77030cc2f6a3d239 MD5 | raw file
  1. <?php
  2. /**
  3. * GetWebhook
  4. *
  5. * PHP version 5
  6. *
  7. * @category Class
  8. * @package SendinBlue\Client
  9. * @author Swagger Codegen team
  10. * @link https://github.com/swagger-api/swagger-codegen
  11. */
  12. /**
  13. * SendinBlue API
  14. *
  15. * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable |
  16. *
  17. * OpenAPI spec version: 3.0.0
  18. * Contact: contact@sendinblue.com
  19. * Generated by: https://github.com/swagger-api/swagger-codegen.git
  20. * Swagger Codegen version: 2.4.12
  21. */
  22. /**
  23. * NOTE: This class is auto generated by the swagger code generator program.
  24. * https://github.com/swagger-api/swagger-codegen
  25. * Do not edit the class manually.
  26. */
  27. namespace SendinBlue\Client\Model;
  28. use \ArrayAccess;
  29. use \SendinBlue\Client\ObjectSerializer;
  30. /**
  31. * GetWebhook Class Doc Comment
  32. *
  33. * @category Class
  34. * @package SendinBlue\Client
  35. * @author Swagger Codegen team
  36. * @link https://github.com/swagger-api/swagger-codegen
  37. */
  38. class GetWebhook implements ModelInterface, ArrayAccess
  39. {
  40. const DISCRIMINATOR = null;
  41. /**
  42. * The original name of the model.
  43. *
  44. * @var string
  45. */
  46. protected static $swaggerModelName = 'getWebhook';
  47. /**
  48. * Array of property to type mappings. Used for (de)serialization
  49. *
  50. * @var string[]
  51. */
  52. protected static $swaggerTypes = [
  53. 'url' => 'string',
  54. 'id' => 'int',
  55. 'description' => 'string',
  56. 'events' => 'string[]',
  57. 'type' => 'string',
  58. 'createdAt' => '\DateTime',
  59. 'modifiedAt' => '\DateTime'
  60. ];
  61. /**
  62. * Array of property to format mappings. Used for (de)serialization
  63. *
  64. * @var string[]
  65. */
  66. protected static $swaggerFormats = [
  67. 'url' => 'url',
  68. 'id' => 'int64',
  69. 'description' => null,
  70. 'events' => null,
  71. 'type' => null,
  72. 'createdAt' => 'date-time',
  73. 'modifiedAt' => 'date-time'
  74. ];
  75. /**
  76. * Array of property to type mappings. Used for (de)serialization
  77. *
  78. * @return array
  79. */
  80. public static function swaggerTypes()
  81. {
  82. return self::$swaggerTypes;
  83. }
  84. /**
  85. * Array of property to format mappings. Used for (de)serialization
  86. *
  87. * @return array
  88. */
  89. public static function swaggerFormats()
  90. {
  91. return self::$swaggerFormats;
  92. }
  93. /**
  94. * Array of attributes where the key is the local name,
  95. * and the value is the original name
  96. *
  97. * @var string[]
  98. */
  99. protected static $attributeMap = [
  100. 'url' => 'url',
  101. 'id' => 'id',
  102. 'description' => 'description',
  103. 'events' => 'events',
  104. 'type' => 'type',
  105. 'createdAt' => 'createdAt',
  106. 'modifiedAt' => 'modifiedAt'
  107. ];
  108. /**
  109. * Array of attributes to setter functions (for deserialization of responses)
  110. *
  111. * @var string[]
  112. */
  113. protected static $setters = [
  114. 'url' => 'setUrl',
  115. 'id' => 'setId',
  116. 'description' => 'setDescription',
  117. 'events' => 'setEvents',
  118. 'type' => 'setType',
  119. 'createdAt' => 'setCreatedAt',
  120. 'modifiedAt' => 'setModifiedAt'
  121. ];
  122. /**
  123. * Array of attributes to getter functions (for serialization of requests)
  124. *
  125. * @var string[]
  126. */
  127. protected static $getters = [
  128. 'url' => 'getUrl',
  129. 'id' => 'getId',
  130. 'description' => 'getDescription',
  131. 'events' => 'getEvents',
  132. 'type' => 'getType',
  133. 'createdAt' => 'getCreatedAt',
  134. 'modifiedAt' => 'getModifiedAt'
  135. ];
  136. /**
  137. * Array of attributes where the key is the local name,
  138. * and the value is the original name
  139. *
  140. * @return array
  141. */
  142. public static function attributeMap()
  143. {
  144. return self::$attributeMap;
  145. }
  146. /**
  147. * Array of attributes to setter functions (for deserialization of responses)
  148. *
  149. * @return array
  150. */
  151. public static function setters()
  152. {
  153. return self::$setters;
  154. }
  155. /**
  156. * Array of attributes to getter functions (for serialization of requests)
  157. *
  158. * @return array
  159. */
  160. public static function getters()
  161. {
  162. return self::$getters;
  163. }
  164. /**
  165. * The original name of the model.
  166. *
  167. * @return string
  168. */
  169. public function getModelName()
  170. {
  171. return self::$swaggerModelName;
  172. }
  173. const TYPE_MARKETING = 'marketing';
  174. const TYPE_TRANSAC = 'transac';
  175. /**
  176. * Gets allowable values of the enum
  177. *
  178. * @return string[]
  179. */
  180. public function getTypeAllowableValues()
  181. {
  182. return [
  183. self::TYPE_MARKETING,
  184. self::TYPE_TRANSAC,
  185. ];
  186. }
  187. /**
  188. * Associative array for storing property values
  189. *
  190. * @var mixed[]
  191. */
  192. protected $container = [];
  193. /**
  194. * Constructor
  195. *
  196. * @param mixed[] $data Associated array of property values
  197. * initializing the model
  198. */
  199. public function __construct(array $data = null)
  200. {
  201. $this->container['url'] = isset($data['url']) ? $data['url'] : null;
  202. $this->container['id'] = isset($data['id']) ? $data['id'] : null;
  203. $this->container['description'] = isset($data['description']) ? $data['description'] : null;
  204. $this->container['events'] = isset($data['events']) ? $data['events'] : null;
  205. $this->container['type'] = isset($data['type']) ? $data['type'] : null;
  206. $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
  207. $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null;
  208. }
  209. /**
  210. * Show all the invalid properties with reasons.
  211. *
  212. * @return array invalid properties with reasons
  213. */
  214. public function listInvalidProperties()
  215. {
  216. $invalidProperties = [];
  217. if ($this->container['url'] === null) {
  218. $invalidProperties[] = "'url' can't be null";
  219. }
  220. if ($this->container['id'] === null) {
  221. $invalidProperties[] = "'id' can't be null";
  222. }
  223. if ($this->container['description'] === null) {
  224. $invalidProperties[] = "'description' can't be null";
  225. }
  226. if ($this->container['events'] === null) {
  227. $invalidProperties[] = "'events' can't be null";
  228. }
  229. if ($this->container['type'] === null) {
  230. $invalidProperties[] = "'type' can't be null";
  231. }
  232. $allowedValues = $this->getTypeAllowableValues();
  233. if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
  234. $invalidProperties[] = sprintf(
  235. "invalid value for 'type', must be one of '%s'",
  236. implode("', '", $allowedValues)
  237. );
  238. }
  239. if ($this->container['createdAt'] === null) {
  240. $invalidProperties[] = "'createdAt' can't be null";
  241. }
  242. if ($this->container['modifiedAt'] === null) {
  243. $invalidProperties[] = "'modifiedAt' can't be null";
  244. }
  245. return $invalidProperties;
  246. }
  247. /**
  248. * Validate all the properties in the model
  249. * return true if all passed
  250. *
  251. * @return bool True if all properties are valid
  252. */
  253. public function valid()
  254. {
  255. return count($this->listInvalidProperties()) === 0;
  256. }
  257. /**
  258. * Gets url
  259. *
  260. * @return string
  261. */
  262. public function getUrl()
  263. {
  264. return $this->container['url'];
  265. }
  266. /**
  267. * Sets url
  268. *
  269. * @param string $url URL of the webhook
  270. *
  271. * @return $this
  272. */
  273. public function setUrl($url)
  274. {
  275. $this->container['url'] = $url;
  276. return $this;
  277. }
  278. /**
  279. * Gets id
  280. *
  281. * @return int
  282. */
  283. public function getId()
  284. {
  285. return $this->container['id'];
  286. }
  287. /**
  288. * Sets id
  289. *
  290. * @param int $id ID of the webhook
  291. *
  292. * @return $this
  293. */
  294. public function setId($id)
  295. {
  296. $this->container['id'] = $id;
  297. return $this;
  298. }
  299. /**
  300. * Gets description
  301. *
  302. * @return string
  303. */
  304. public function getDescription()
  305. {
  306. return $this->container['description'];
  307. }
  308. /**
  309. * Sets description
  310. *
  311. * @param string $description Description of the webhook
  312. *
  313. * @return $this
  314. */
  315. public function setDescription($description)
  316. {
  317. $this->container['description'] = $description;
  318. return $this;
  319. }
  320. /**
  321. * Gets events
  322. *
  323. * @return string[]
  324. */
  325. public function getEvents()
  326. {
  327. return $this->container['events'];
  328. }
  329. /**
  330. * Sets events
  331. *
  332. * @param string[] $events events
  333. *
  334. * @return $this
  335. */
  336. public function setEvents($events)
  337. {
  338. $this->container['events'] = $events;
  339. return $this;
  340. }
  341. /**
  342. * Gets type
  343. *
  344. * @return string
  345. */
  346. public function getType()
  347. {
  348. return $this->container['type'];
  349. }
  350. /**
  351. * Sets type
  352. *
  353. * @param string $type Type of webhook (marketing or transac)
  354. *
  355. * @return $this
  356. */
  357. public function setType($type)
  358. {
  359. $allowedValues = $this->getTypeAllowableValues();
  360. if (!in_array($type, $allowedValues, true)) {
  361. throw new \InvalidArgumentException(
  362. sprintf(
  363. "Invalid value for 'type', must be one of '%s'",
  364. implode("', '", $allowedValues)
  365. )
  366. );
  367. }
  368. $this->container['type'] = $type;
  369. return $this;
  370. }
  371. /**
  372. * Gets createdAt
  373. *
  374. * @return \DateTime
  375. */
  376. public function getCreatedAt()
  377. {
  378. return $this->container['createdAt'];
  379. }
  380. /**
  381. * Sets createdAt
  382. *
  383. * @param \DateTime $createdAt Creation UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ)
  384. *
  385. * @return $this
  386. */
  387. public function setCreatedAt($createdAt)
  388. {
  389. $this->container['createdAt'] = $createdAt;
  390. return $this;
  391. }
  392. /**
  393. * Gets modifiedAt
  394. *
  395. * @return \DateTime
  396. */
  397. public function getModifiedAt()
  398. {
  399. return $this->container['modifiedAt'];
  400. }
  401. /**
  402. * Sets modifiedAt
  403. *
  404. * @param \DateTime $modifiedAt Last modification UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ)
  405. *
  406. * @return $this
  407. */
  408. public function setModifiedAt($modifiedAt)
  409. {
  410. $this->container['modifiedAt'] = $modifiedAt;
  411. return $this;
  412. }
  413. /**
  414. * Returns true if offset exists. False otherwise.
  415. *
  416. * @param integer $offset Offset
  417. *
  418. * @return boolean
  419. */
  420. public function offsetExists($offset)
  421. {
  422. return isset($this->container[$offset]);
  423. }
  424. /**
  425. * Gets offset.
  426. *
  427. * @param integer $offset Offset
  428. *
  429. * @return mixed
  430. */
  431. public function offsetGet($offset)
  432. {
  433. return isset($this->container[$offset]) ? $this->container[$offset] : null;
  434. }
  435. /**
  436. * Sets value based on offset.
  437. *
  438. * @param integer $offset Offset
  439. * @param mixed $value Value to be set
  440. *
  441. * @return void
  442. */
  443. public function offsetSet($offset, $value)
  444. {
  445. if (is_null($offset)) {
  446. $this->container[] = $value;
  447. } else {
  448. $this->container[$offset] = $value;
  449. }
  450. }
  451. /**
  452. * Unsets offset.
  453. *
  454. * @param integer $offset Offset
  455. *
  456. * @return void
  457. */
  458. public function offsetUnset($offset)
  459. {
  460. unset($this->container[$offset]);
  461. }
  462. /**
  463. * Gets the string presentation of the object
  464. *
  465. * @return string
  466. */
  467. public function __toString()
  468. {
  469. if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
  470. return json_encode(
  471. ObjectSerializer::sanitizeForSerialization($this),
  472. JSON_PRETTY_PRINT
  473. );
  474. }
  475. return json_encode(ObjectSerializer::sanitizeForSerialization($this));
  476. }
  477. }