PageRenderTime 23ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/vendor/sendinblue/api-v3-sdk/lib/Model/RequestContactImport.php

https://gitlab.com/i-have-a-green/digitemis-v3
PHP | 541 lines | 221 code | 61 blank | 259 comment | 3 complexity | 79ab0a39a919d7ba5e0015130e7d0d6b MD5 | raw file
  1. <?php
  2. /**
  3. * RequestContactImport
  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. * RequestContactImport 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 RequestContactImport 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 = 'requestContactImport';
  47. /**
  48. * Array of property to type mappings. Used for (de)serialization
  49. *
  50. * @var string[]
  51. */
  52. protected static $swaggerTypes = [
  53. 'fileUrl' => 'string',
  54. 'fileBody' => 'string',
  55. 'listIds' => 'int[]',
  56. 'notifyUrl' => 'string',
  57. 'newList' => '\SendinBlue\Client\Model\RequestContactImportNewList',
  58. 'emailBlacklist' => 'bool',
  59. 'smsBlacklist' => 'bool',
  60. 'updateExistingContacts' => 'bool',
  61. 'emptyContactsAttributes' => 'bool'
  62. ];
  63. /**
  64. * Array of property to format mappings. Used for (de)serialization
  65. *
  66. * @var string[]
  67. */
  68. protected static $swaggerFormats = [
  69. 'fileUrl' => 'url',
  70. 'fileBody' => null,
  71. 'listIds' => 'int64',
  72. 'notifyUrl' => 'url',
  73. 'newList' => null,
  74. 'emailBlacklist' => null,
  75. 'smsBlacklist' => null,
  76. 'updateExistingContacts' => null,
  77. 'emptyContactsAttributes' => null
  78. ];
  79. /**
  80. * Array of property to type mappings. Used for (de)serialization
  81. *
  82. * @return array
  83. */
  84. public static function swaggerTypes()
  85. {
  86. return self::$swaggerTypes;
  87. }
  88. /**
  89. * Array of property to format mappings. Used for (de)serialization
  90. *
  91. * @return array
  92. */
  93. public static function swaggerFormats()
  94. {
  95. return self::$swaggerFormats;
  96. }
  97. /**
  98. * Array of attributes where the key is the local name,
  99. * and the value is the original name
  100. *
  101. * @var string[]
  102. */
  103. protected static $attributeMap = [
  104. 'fileUrl' => 'fileUrl',
  105. 'fileBody' => 'fileBody',
  106. 'listIds' => 'listIds',
  107. 'notifyUrl' => 'notifyUrl',
  108. 'newList' => 'newList',
  109. 'emailBlacklist' => 'emailBlacklist',
  110. 'smsBlacklist' => 'smsBlacklist',
  111. 'updateExistingContacts' => 'updateExistingContacts',
  112. 'emptyContactsAttributes' => 'emptyContactsAttributes'
  113. ];
  114. /**
  115. * Array of attributes to setter functions (for deserialization of responses)
  116. *
  117. * @var string[]
  118. */
  119. protected static $setters = [
  120. 'fileUrl' => 'setFileUrl',
  121. 'fileBody' => 'setFileBody',
  122. 'listIds' => 'setListIds',
  123. 'notifyUrl' => 'setNotifyUrl',
  124. 'newList' => 'setNewList',
  125. 'emailBlacklist' => 'setEmailBlacklist',
  126. 'smsBlacklist' => 'setSmsBlacklist',
  127. 'updateExistingContacts' => 'setUpdateExistingContacts',
  128. 'emptyContactsAttributes' => 'setEmptyContactsAttributes'
  129. ];
  130. /**
  131. * Array of attributes to getter functions (for serialization of requests)
  132. *
  133. * @var string[]
  134. */
  135. protected static $getters = [
  136. 'fileUrl' => 'getFileUrl',
  137. 'fileBody' => 'getFileBody',
  138. 'listIds' => 'getListIds',
  139. 'notifyUrl' => 'getNotifyUrl',
  140. 'newList' => 'getNewList',
  141. 'emailBlacklist' => 'getEmailBlacklist',
  142. 'smsBlacklist' => 'getSmsBlacklist',
  143. 'updateExistingContacts' => 'getUpdateExistingContacts',
  144. 'emptyContactsAttributes' => 'getEmptyContactsAttributes'
  145. ];
  146. /**
  147. * Array of attributes where the key is the local name,
  148. * and the value is the original name
  149. *
  150. * @return array
  151. */
  152. public static function attributeMap()
  153. {
  154. return self::$attributeMap;
  155. }
  156. /**
  157. * Array of attributes to setter functions (for deserialization of responses)
  158. *
  159. * @return array
  160. */
  161. public static function setters()
  162. {
  163. return self::$setters;
  164. }
  165. /**
  166. * Array of attributes to getter functions (for serialization of requests)
  167. *
  168. * @return array
  169. */
  170. public static function getters()
  171. {
  172. return self::$getters;
  173. }
  174. /**
  175. * The original name of the model.
  176. *
  177. * @return string
  178. */
  179. public function getModelName()
  180. {
  181. return self::$swaggerModelName;
  182. }
  183. /**
  184. * Associative array for storing property values
  185. *
  186. * @var mixed[]
  187. */
  188. protected $container = [];
  189. /**
  190. * Constructor
  191. *
  192. * @param mixed[] $data Associated array of property values
  193. * initializing the model
  194. */
  195. public function __construct(array $data = null)
  196. {
  197. $this->container['fileUrl'] = isset($data['fileUrl']) ? $data['fileUrl'] : null;
  198. $this->container['fileBody'] = isset($data['fileBody']) ? $data['fileBody'] : null;
  199. $this->container['listIds'] = isset($data['listIds']) ? $data['listIds'] : null;
  200. $this->container['notifyUrl'] = isset($data['notifyUrl']) ? $data['notifyUrl'] : null;
  201. $this->container['newList'] = isset($data['newList']) ? $data['newList'] : null;
  202. $this->container['emailBlacklist'] = isset($data['emailBlacklist']) ? $data['emailBlacklist'] : false;
  203. $this->container['smsBlacklist'] = isset($data['smsBlacklist']) ? $data['smsBlacklist'] : false;
  204. $this->container['updateExistingContacts'] = isset($data['updateExistingContacts']) ? $data['updateExistingContacts'] : true;
  205. $this->container['emptyContactsAttributes'] = isset($data['emptyContactsAttributes']) ? $data['emptyContactsAttributes'] : false;
  206. }
  207. /**
  208. * Show all the invalid properties with reasons.
  209. *
  210. * @return array invalid properties with reasons
  211. */
  212. public function listInvalidProperties()
  213. {
  214. $invalidProperties = [];
  215. return $invalidProperties;
  216. }
  217. /**
  218. * Validate all the properties in the model
  219. * return true if all passed
  220. *
  221. * @return bool True if all properties are valid
  222. */
  223. public function valid()
  224. {
  225. return count($this->listInvalidProperties()) === 0;
  226. }
  227. /**
  228. * Gets fileUrl
  229. *
  230. * @return string
  231. */
  232. public function getFileUrl()
  233. {
  234. return $this->container['fileUrl'];
  235. }
  236. /**
  237. * Sets fileUrl
  238. *
  239. * @param string $fileUrl Mandatory if fileBody is not defined. URL of the file to be imported (no local file). Possible file formats: .txt, .csv
  240. *
  241. * @return $this
  242. */
  243. public function setFileUrl($fileUrl)
  244. {
  245. $this->container['fileUrl'] = $fileUrl;
  246. return $this;
  247. }
  248. /**
  249. * Gets fileBody
  250. *
  251. * @return string
  252. */
  253. public function getFileBody()
  254. {
  255. return $this->container['fileBody'];
  256. }
  257. /**
  258. * Sets fileBody
  259. *
  260. * @param string $fileBody Mandatory if fileUrl is not defined. CSV content to be imported. Use semicolon to separate multiple attributes. Maximum allowed file body size is 10MB . However we recommend a safe limit of around 8 MB to avoid the issues caused due to increase of file body size while parsing. Please use fileUrl instead to import bigger files.
  261. *
  262. * @return $this
  263. */
  264. public function setFileBody($fileBody)
  265. {
  266. $this->container['fileBody'] = $fileBody;
  267. return $this;
  268. }
  269. /**
  270. * Gets listIds
  271. *
  272. * @return int[]
  273. */
  274. public function getListIds()
  275. {
  276. return $this->container['listIds'];
  277. }
  278. /**
  279. * Sets listIds
  280. *
  281. * @param int[] $listIds Mandatory if newList is not defined. Ids of the lists in which the contacts shall be imported. For example, [2, 4, 7].
  282. *
  283. * @return $this
  284. */
  285. public function setListIds($listIds)
  286. {
  287. $this->container['listIds'] = $listIds;
  288. return $this;
  289. }
  290. /**
  291. * Gets notifyUrl
  292. *
  293. * @return string
  294. */
  295. public function getNotifyUrl()
  296. {
  297. return $this->container['notifyUrl'];
  298. }
  299. /**
  300. * Sets notifyUrl
  301. *
  302. * @param string $notifyUrl URL that will be called once the export process is finished
  303. *
  304. * @return $this
  305. */
  306. public function setNotifyUrl($notifyUrl)
  307. {
  308. $this->container['notifyUrl'] = $notifyUrl;
  309. return $this;
  310. }
  311. /**
  312. * Gets newList
  313. *
  314. * @return \SendinBlue\Client\Model\RequestContactImportNewList
  315. */
  316. public function getNewList()
  317. {
  318. return $this->container['newList'];
  319. }
  320. /**
  321. * Sets newList
  322. *
  323. * @param \SendinBlue\Client\Model\RequestContactImportNewList $newList newList
  324. *
  325. * @return $this
  326. */
  327. public function setNewList($newList)
  328. {
  329. $this->container['newList'] = $newList;
  330. return $this;
  331. }
  332. /**
  333. * Gets emailBlacklist
  334. *
  335. * @return bool
  336. */
  337. public function getEmailBlacklist()
  338. {
  339. return $this->container['emailBlacklist'];
  340. }
  341. /**
  342. * Sets emailBlacklist
  343. *
  344. * @param bool $emailBlacklist To blacklist all the contacts for email
  345. *
  346. * @return $this
  347. */
  348. public function setEmailBlacklist($emailBlacklist)
  349. {
  350. $this->container['emailBlacklist'] = $emailBlacklist;
  351. return $this;
  352. }
  353. /**
  354. * Gets smsBlacklist
  355. *
  356. * @return bool
  357. */
  358. public function getSmsBlacklist()
  359. {
  360. return $this->container['smsBlacklist'];
  361. }
  362. /**
  363. * Sets smsBlacklist
  364. *
  365. * @param bool $smsBlacklist To blacklist all the contacts for sms
  366. *
  367. * @return $this
  368. */
  369. public function setSmsBlacklist($smsBlacklist)
  370. {
  371. $this->container['smsBlacklist'] = $smsBlacklist;
  372. return $this;
  373. }
  374. /**
  375. * Gets updateExistingContacts
  376. *
  377. * @return bool
  378. */
  379. public function getUpdateExistingContacts()
  380. {
  381. return $this->container['updateExistingContacts'];
  382. }
  383. /**
  384. * Sets updateExistingContacts
  385. *
  386. * @param bool $updateExistingContacts To facilitate the choice to update the existing contacts
  387. *
  388. * @return $this
  389. */
  390. public function setUpdateExistingContacts($updateExistingContacts)
  391. {
  392. $this->container['updateExistingContacts'] = $updateExistingContacts;
  393. return $this;
  394. }
  395. /**
  396. * Gets emptyContactsAttributes
  397. *
  398. * @return bool
  399. */
  400. public function getEmptyContactsAttributes()
  401. {
  402. return $this->container['emptyContactsAttributes'];
  403. }
  404. /**
  405. * Sets emptyContactsAttributes
  406. *
  407. * @param bool $emptyContactsAttributes To facilitate the choice to erase any attribute of the existing contacts with empty value. emptyContactsAttributes = true means the empty fields in your import will erase any attribute that currently contain data in SendinBlue, & emptyContactsAttributes = false means the empty fields will not affect your existing data ( only available if `updateExistingContacts` set to true )
  408. *
  409. * @return $this
  410. */
  411. public function setEmptyContactsAttributes($emptyContactsAttributes)
  412. {
  413. $this->container['emptyContactsAttributes'] = $emptyContactsAttributes;
  414. return $this;
  415. }
  416. /**
  417. * Returns true if offset exists. False otherwise.
  418. *
  419. * @param integer $offset Offset
  420. *
  421. * @return boolean
  422. */
  423. public function offsetExists($offset)
  424. {
  425. return isset($this->container[$offset]);
  426. }
  427. /**
  428. * Gets offset.
  429. *
  430. * @param integer $offset Offset
  431. *
  432. * @return mixed
  433. */
  434. public function offsetGet($offset)
  435. {
  436. return isset($this->container[$offset]) ? $this->container[$offset] : null;
  437. }
  438. /**
  439. * Sets value based on offset.
  440. *
  441. * @param integer $offset Offset
  442. * @param mixed $value Value to be set
  443. *
  444. * @return void
  445. */
  446. public function offsetSet($offset, $value)
  447. {
  448. if (is_null($offset)) {
  449. $this->container[] = $value;
  450. } else {
  451. $this->container[$offset] = $value;
  452. }
  453. }
  454. /**
  455. * Unsets offset.
  456. *
  457. * @param integer $offset Offset
  458. *
  459. * @return void
  460. */
  461. public function offsetUnset($offset)
  462. {
  463. unset($this->container[$offset]);
  464. }
  465. /**
  466. * Gets the string presentation of the object
  467. *
  468. * @return string
  469. */
  470. public function __toString()
  471. {
  472. if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
  473. return json_encode(
  474. ObjectSerializer::sanitizeForSerialization($this),
  475. JSON_PRETTY_PRINT
  476. );
  477. }
  478. return json_encode(ObjectSerializer::sanitizeForSerialization($this));
  479. }
  480. }