PageRenderTime 40ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/plugins/google-listings-and-ads/vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/V9/Resources/MediaFile.php

https://gitlab.com/remyvianne/krowkaramel
PHP | 468 lines | 182 code | 52 blank | 234 comment | 0 complexity | 366a36fd3938d7fd3ba525b5e65c7b94 MD5 | raw file
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: google/ads/googleads/v9/resources/media_file.proto
  4. namespace Google\Ads\GoogleAds\V9\Resources;
  5. use Google\Protobuf\Internal\GPBType;
  6. use Google\Protobuf\Internal\RepeatedField;
  7. use Google\Protobuf\Internal\GPBUtil;
  8. /**
  9. * A media file.
  10. *
  11. * Generated from protobuf message <code>google.ads.googleads.v9.resources.MediaFile</code>
  12. */
  13. class MediaFile extends \Google\Protobuf\Internal\Message
  14. {
  15. /**
  16. * Immutable. The resource name of the media file.
  17. * Media file resource names have the form:
  18. * `customers/{customer_id}/mediaFiles/{media_file_id}`
  19. *
  20. * Generated from protobuf field <code>string resource_name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = {</code>
  21. */
  22. protected $resource_name = '';
  23. /**
  24. * Output only. The ID of the media file.
  25. *
  26. * Generated from protobuf field <code>optional int64 id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
  27. */
  28. protected $id = null;
  29. /**
  30. * Immutable. Type of the media file.
  31. *
  32. * Generated from protobuf field <code>.google.ads.googleads.v9.enums.MediaTypeEnum.MediaType type = 5 [(.google.api.field_behavior) = IMMUTABLE];</code>
  33. */
  34. protected $type = 0;
  35. /**
  36. * Output only. The mime type of the media file.
  37. *
  38. * Generated from protobuf field <code>.google.ads.googleads.v9.enums.MimeTypeEnum.MimeType mime_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
  39. */
  40. protected $mime_type = 0;
  41. /**
  42. * Immutable. The URL of where the original media file was downloaded from (or a file
  43. * name). Only used for media of type AUDIO and IMAGE.
  44. *
  45. * Generated from protobuf field <code>optional string source_url = 13 [(.google.api.field_behavior) = IMMUTABLE];</code>
  46. */
  47. protected $source_url = null;
  48. /**
  49. * Immutable. The name of the media file. The name can be used by clients to help
  50. * identify previously uploaded media.
  51. *
  52. * Generated from protobuf field <code>optional string name = 14 [(.google.api.field_behavior) = IMMUTABLE];</code>
  53. */
  54. protected $name = null;
  55. /**
  56. * Output only. The size of the media file in bytes.
  57. *
  58. * Generated from protobuf field <code>optional int64 file_size = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
  59. */
  60. protected $file_size = null;
  61. protected $mediatype;
  62. /**
  63. * Constructor.
  64. *
  65. * @param array $data {
  66. * Optional. Data for populating the Message object.
  67. *
  68. * @type string $resource_name
  69. * Immutable. The resource name of the media file.
  70. * Media file resource names have the form:
  71. * `customers/{customer_id}/mediaFiles/{media_file_id}`
  72. * @type int|string $id
  73. * Output only. The ID of the media file.
  74. * @type int $type
  75. * Immutable. Type of the media file.
  76. * @type int $mime_type
  77. * Output only. The mime type of the media file.
  78. * @type string $source_url
  79. * Immutable. The URL of where the original media file was downloaded from (or a file
  80. * name). Only used for media of type AUDIO and IMAGE.
  81. * @type string $name
  82. * Immutable. The name of the media file. The name can be used by clients to help
  83. * identify previously uploaded media.
  84. * @type int|string $file_size
  85. * Output only. The size of the media file in bytes.
  86. * @type \Google\Ads\GoogleAds\V9\Resources\MediaImage $image
  87. * Immutable. Encapsulates an Image.
  88. * @type \Google\Ads\GoogleAds\V9\Resources\MediaBundle $media_bundle
  89. * Immutable. A ZIP archive media the content of which contains HTML5 assets.
  90. * @type \Google\Ads\GoogleAds\V9\Resources\MediaAudio $audio
  91. * Output only. Encapsulates an Audio.
  92. * @type \Google\Ads\GoogleAds\V9\Resources\MediaVideo $video
  93. * Immutable. Encapsulates a Video.
  94. * }
  95. */
  96. public function __construct($data = NULL) {
  97. \GPBMetadata\Google\Ads\GoogleAds\V9\Resources\MediaFile::initOnce();
  98. parent::__construct($data);
  99. }
  100. /**
  101. * Immutable. The resource name of the media file.
  102. * Media file resource names have the form:
  103. * `customers/{customer_id}/mediaFiles/{media_file_id}`
  104. *
  105. * Generated from protobuf field <code>string resource_name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = {</code>
  106. * @return string
  107. */
  108. public function getResourceName()
  109. {
  110. return $this->resource_name;
  111. }
  112. /**
  113. * Immutable. The resource name of the media file.
  114. * Media file resource names have the form:
  115. * `customers/{customer_id}/mediaFiles/{media_file_id}`
  116. *
  117. * Generated from protobuf field <code>string resource_name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = {</code>
  118. * @param string $var
  119. * @return $this
  120. */
  121. public function setResourceName($var)
  122. {
  123. GPBUtil::checkString($var, True);
  124. $this->resource_name = $var;
  125. return $this;
  126. }
  127. /**
  128. * Output only. The ID of the media file.
  129. *
  130. * Generated from protobuf field <code>optional int64 id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
  131. * @return int|string
  132. */
  133. public function getId()
  134. {
  135. return isset($this->id) ? $this->id : 0;
  136. }
  137. public function hasId()
  138. {
  139. return isset($this->id);
  140. }
  141. public function clearId()
  142. {
  143. unset($this->id);
  144. }
  145. /**
  146. * Output only. The ID of the media file.
  147. *
  148. * Generated from protobuf field <code>optional int64 id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
  149. * @param int|string $var
  150. * @return $this
  151. */
  152. public function setId($var)
  153. {
  154. GPBUtil::checkInt64($var);
  155. $this->id = $var;
  156. return $this;
  157. }
  158. /**
  159. * Immutable. Type of the media file.
  160. *
  161. * Generated from protobuf field <code>.google.ads.googleads.v9.enums.MediaTypeEnum.MediaType type = 5 [(.google.api.field_behavior) = IMMUTABLE];</code>
  162. * @return int
  163. */
  164. public function getType()
  165. {
  166. return $this->type;
  167. }
  168. /**
  169. * Immutable. Type of the media file.
  170. *
  171. * Generated from protobuf field <code>.google.ads.googleads.v9.enums.MediaTypeEnum.MediaType type = 5 [(.google.api.field_behavior) = IMMUTABLE];</code>
  172. * @param int $var
  173. * @return $this
  174. */
  175. public function setType($var)
  176. {
  177. GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V9\Enums\MediaTypeEnum\MediaType::class);
  178. $this->type = $var;
  179. return $this;
  180. }
  181. /**
  182. * Output only. The mime type of the media file.
  183. *
  184. * Generated from protobuf field <code>.google.ads.googleads.v9.enums.MimeTypeEnum.MimeType mime_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
  185. * @return int
  186. */
  187. public function getMimeType()
  188. {
  189. return $this->mime_type;
  190. }
  191. /**
  192. * Output only. The mime type of the media file.
  193. *
  194. * Generated from protobuf field <code>.google.ads.googleads.v9.enums.MimeTypeEnum.MimeType mime_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
  195. * @param int $var
  196. * @return $this
  197. */
  198. public function setMimeType($var)
  199. {
  200. GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V9\Enums\MimeTypeEnum\MimeType::class);
  201. $this->mime_type = $var;
  202. return $this;
  203. }
  204. /**
  205. * Immutable. The URL of where the original media file was downloaded from (or a file
  206. * name). Only used for media of type AUDIO and IMAGE.
  207. *
  208. * Generated from protobuf field <code>optional string source_url = 13 [(.google.api.field_behavior) = IMMUTABLE];</code>
  209. * @return string
  210. */
  211. public function getSourceUrl()
  212. {
  213. return isset($this->source_url) ? $this->source_url : '';
  214. }
  215. public function hasSourceUrl()
  216. {
  217. return isset($this->source_url);
  218. }
  219. public function clearSourceUrl()
  220. {
  221. unset($this->source_url);
  222. }
  223. /**
  224. * Immutable. The URL of where the original media file was downloaded from (or a file
  225. * name). Only used for media of type AUDIO and IMAGE.
  226. *
  227. * Generated from protobuf field <code>optional string source_url = 13 [(.google.api.field_behavior) = IMMUTABLE];</code>
  228. * @param string $var
  229. * @return $this
  230. */
  231. public function setSourceUrl($var)
  232. {
  233. GPBUtil::checkString($var, True);
  234. $this->source_url = $var;
  235. return $this;
  236. }
  237. /**
  238. * Immutable. The name of the media file. The name can be used by clients to help
  239. * identify previously uploaded media.
  240. *
  241. * Generated from protobuf field <code>optional string name = 14 [(.google.api.field_behavior) = IMMUTABLE];</code>
  242. * @return string
  243. */
  244. public function getName()
  245. {
  246. return isset($this->name) ? $this->name : '';
  247. }
  248. public function hasName()
  249. {
  250. return isset($this->name);
  251. }
  252. public function clearName()
  253. {
  254. unset($this->name);
  255. }
  256. /**
  257. * Immutable. The name of the media file. The name can be used by clients to help
  258. * identify previously uploaded media.
  259. *
  260. * Generated from protobuf field <code>optional string name = 14 [(.google.api.field_behavior) = IMMUTABLE];</code>
  261. * @param string $var
  262. * @return $this
  263. */
  264. public function setName($var)
  265. {
  266. GPBUtil::checkString($var, True);
  267. $this->name = $var;
  268. return $this;
  269. }
  270. /**
  271. * Output only. The size of the media file in bytes.
  272. *
  273. * Generated from protobuf field <code>optional int64 file_size = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
  274. * @return int|string
  275. */
  276. public function getFileSize()
  277. {
  278. return isset($this->file_size) ? $this->file_size : 0;
  279. }
  280. public function hasFileSize()
  281. {
  282. return isset($this->file_size);
  283. }
  284. public function clearFileSize()
  285. {
  286. unset($this->file_size);
  287. }
  288. /**
  289. * Output only. The size of the media file in bytes.
  290. *
  291. * Generated from protobuf field <code>optional int64 file_size = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
  292. * @param int|string $var
  293. * @return $this
  294. */
  295. public function setFileSize($var)
  296. {
  297. GPBUtil::checkInt64($var);
  298. $this->file_size = $var;
  299. return $this;
  300. }
  301. /**
  302. * Immutable. Encapsulates an Image.
  303. *
  304. * Generated from protobuf field <code>.google.ads.googleads.v9.resources.MediaImage image = 3 [(.google.api.field_behavior) = IMMUTABLE];</code>
  305. * @return \Google\Ads\GoogleAds\V9\Resources\MediaImage|null
  306. */
  307. public function getImage()
  308. {
  309. return $this->readOneof(3);
  310. }
  311. public function hasImage()
  312. {
  313. return $this->hasOneof(3);
  314. }
  315. /**
  316. * Immutable. Encapsulates an Image.
  317. *
  318. * Generated from protobuf field <code>.google.ads.googleads.v9.resources.MediaImage image = 3 [(.google.api.field_behavior) = IMMUTABLE];</code>
  319. * @param \Google\Ads\GoogleAds\V9\Resources\MediaImage $var
  320. * @return $this
  321. */
  322. public function setImage($var)
  323. {
  324. GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V9\Resources\MediaImage::class);
  325. $this->writeOneof(3, $var);
  326. return $this;
  327. }
  328. /**
  329. * Immutable. A ZIP archive media the content of which contains HTML5 assets.
  330. *
  331. * Generated from protobuf field <code>.google.ads.googleads.v9.resources.MediaBundle media_bundle = 4 [(.google.api.field_behavior) = IMMUTABLE];</code>
  332. * @return \Google\Ads\GoogleAds\V9\Resources\MediaBundle|null
  333. */
  334. public function getMediaBundle()
  335. {
  336. return $this->readOneof(4);
  337. }
  338. public function hasMediaBundle()
  339. {
  340. return $this->hasOneof(4);
  341. }
  342. /**
  343. * Immutable. A ZIP archive media the content of which contains HTML5 assets.
  344. *
  345. * Generated from protobuf field <code>.google.ads.googleads.v9.resources.MediaBundle media_bundle = 4 [(.google.api.field_behavior) = IMMUTABLE];</code>
  346. * @param \Google\Ads\GoogleAds\V9\Resources\MediaBundle $var
  347. * @return $this
  348. */
  349. public function setMediaBundle($var)
  350. {
  351. GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V9\Resources\MediaBundle::class);
  352. $this->writeOneof(4, $var);
  353. return $this;
  354. }
  355. /**
  356. * Output only. Encapsulates an Audio.
  357. *
  358. * Generated from protobuf field <code>.google.ads.googleads.v9.resources.MediaAudio audio = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
  359. * @return \Google\Ads\GoogleAds\V9\Resources\MediaAudio|null
  360. */
  361. public function getAudio()
  362. {
  363. return $this->readOneof(10);
  364. }
  365. public function hasAudio()
  366. {
  367. return $this->hasOneof(10);
  368. }
  369. /**
  370. * Output only. Encapsulates an Audio.
  371. *
  372. * Generated from protobuf field <code>.google.ads.googleads.v9.resources.MediaAudio audio = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
  373. * @param \Google\Ads\GoogleAds\V9\Resources\MediaAudio $var
  374. * @return $this
  375. */
  376. public function setAudio($var)
  377. {
  378. GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V9\Resources\MediaAudio::class);
  379. $this->writeOneof(10, $var);
  380. return $this;
  381. }
  382. /**
  383. * Immutable. Encapsulates a Video.
  384. *
  385. * Generated from protobuf field <code>.google.ads.googleads.v9.resources.MediaVideo video = 11 [(.google.api.field_behavior) = IMMUTABLE];</code>
  386. * @return \Google\Ads\GoogleAds\V9\Resources\MediaVideo|null
  387. */
  388. public function getVideo()
  389. {
  390. return $this->readOneof(11);
  391. }
  392. public function hasVideo()
  393. {
  394. return $this->hasOneof(11);
  395. }
  396. /**
  397. * Immutable. Encapsulates a Video.
  398. *
  399. * Generated from protobuf field <code>.google.ads.googleads.v9.resources.MediaVideo video = 11 [(.google.api.field_behavior) = IMMUTABLE];</code>
  400. * @param \Google\Ads\GoogleAds\V9\Resources\MediaVideo $var
  401. * @return $this
  402. */
  403. public function setVideo($var)
  404. {
  405. GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V9\Resources\MediaVideo::class);
  406. $this->writeOneof(11, $var);
  407. return $this;
  408. }
  409. /**
  410. * @return string
  411. */
  412. public function getMediatype()
  413. {
  414. return $this->whichOneof("mediatype");
  415. }
  416. }