ReplaceImageRequest.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <?php
  2. /*
  3. * Copyright 2014 Google Inc.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  6. * use this file except in compliance with the License. You may obtain a copy of
  7. * the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  13. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  14. * License for the specific language governing permissions and limitations under
  15. * the License.
  16. */
  17. namespace Google\Service\Slides;
  18. class ReplaceImageRequest extends \Google\Model
  19. {
  20. /**
  21. * Unspecified image replace method. This value must not be used.
  22. */
  23. public const IMAGE_REPLACE_METHOD_IMAGE_REPLACE_METHOD_UNSPECIFIED = 'IMAGE_REPLACE_METHOD_UNSPECIFIED';
  24. /**
  25. * Scales and centers the image to fit within the bounds of the original shape
  26. * and maintains the image's aspect ratio. The rendered size of the image may
  27. * be smaller than the size of the shape. This is the default method when one
  28. * is not specified.
  29. */
  30. public const IMAGE_REPLACE_METHOD_CENTER_INSIDE = 'CENTER_INSIDE';
  31. /**
  32. * Scales and centers the image to fill the bounds of the original shape. The
  33. * image may be cropped in order to fill the shape. The rendered size of the
  34. * image will be the same as the original shape.
  35. */
  36. public const IMAGE_REPLACE_METHOD_CENTER_CROP = 'CENTER_CROP';
  37. /**
  38. * The ID of the existing image that will be replaced. The ID can be retrieved
  39. * from the response of a get request.
  40. *
  41. * @var string
  42. */
  43. public $imageObjectId;
  44. /**
  45. * The replacement method.
  46. *
  47. * @var string
  48. */
  49. public $imageReplaceMethod;
  50. /**
  51. * The image URL. The image is fetched once at insertion time and a copy is
  52. * stored for display inside the presentation. Images must be less than 50MB,
  53. * cannot exceed 25 megapixels, and must be in PNG, JPEG, or GIF format. The
  54. * provided URL can't surpass 2 KB in length. The URL is saved with the image,
  55. * and exposed through the Image.source_url field.
  56. *
  57. * @var string
  58. */
  59. public $url;
  60. /**
  61. * The ID of the existing image that will be replaced. The ID can be retrieved
  62. * from the response of a get request.
  63. *
  64. * @param string $imageObjectId
  65. */
  66. public function setImageObjectId($imageObjectId)
  67. {
  68. $this->imageObjectId = $imageObjectId;
  69. }
  70. /**
  71. * @return string
  72. */
  73. public function getImageObjectId()
  74. {
  75. return $this->imageObjectId;
  76. }
  77. /**
  78. * The replacement method.
  79. *
  80. * Accepted values: IMAGE_REPLACE_METHOD_UNSPECIFIED, CENTER_INSIDE,
  81. * CENTER_CROP
  82. *
  83. * @param self::IMAGE_REPLACE_METHOD_* $imageReplaceMethod
  84. */
  85. public function setImageReplaceMethod($imageReplaceMethod)
  86. {
  87. $this->imageReplaceMethod = $imageReplaceMethod;
  88. }
  89. /**
  90. * @return self::IMAGE_REPLACE_METHOD_*
  91. */
  92. public function getImageReplaceMethod()
  93. {
  94. return $this->imageReplaceMethod;
  95. }
  96. /**
  97. * The image URL. The image is fetched once at insertion time and a copy is
  98. * stored for display inside the presentation. Images must be less than 50MB,
  99. * cannot exceed 25 megapixels, and must be in PNG, JPEG, or GIF format. The
  100. * provided URL can't surpass 2 KB in length. The URL is saved with the image,
  101. * and exposed through the Image.source_url field.
  102. *
  103. * @param string $url
  104. */
  105. public function setUrl($url)
  106. {
  107. $this->url = $url;
  108. }
  109. /**
  110. * @return string
  111. */
  112. public function getUrl()
  113. {
  114. return $this->url;
  115. }
  116. }
  117. // Adding a class alias for backwards compatibility with the previous class name.
  118. class_alias(ReplaceImageRequest::class, 'Google_Service_Slides_ReplaceImageRequest');