FirewallAllowed.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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\Compute;
  18. class FirewallAllowed extends \Google\Collection
  19. {
  20. protected $collection_key = 'ports';
  21. protected $internal_gapi_mappings = [
  22. "iPProtocol" => "IPProtocol",
  23. ];
  24. /**
  25. * The IP protocol to which this rule applies. The protocol type is required
  26. * when creating a firewall rule. This value can either be one of the
  27. * following well known protocol strings (tcp, udp,icmp, esp, ah, ipip,sctp)
  28. * or the IP protocol number.
  29. *
  30. * @var string
  31. */
  32. public $iPProtocol;
  33. /**
  34. * An optional list of ports to which this rule applies. This field is only
  35. * applicable for the UDP or TCP protocol. Each entry must be either an
  36. * integer or a range. If not specified, this rule applies to connections
  37. * through any port.
  38. *
  39. * Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  40. *
  41. * @var string[]
  42. */
  43. public $ports;
  44. /**
  45. * The IP protocol to which this rule applies. The protocol type is required
  46. * when creating a firewall rule. This value can either be one of the
  47. * following well known protocol strings (tcp, udp,icmp, esp, ah, ipip,sctp)
  48. * or the IP protocol number.
  49. *
  50. * @param string $iPProtocol
  51. */
  52. public function setIPProtocol($iPProtocol)
  53. {
  54. $this->iPProtocol = $iPProtocol;
  55. }
  56. /**
  57. * @return string
  58. */
  59. public function getIPProtocol()
  60. {
  61. return $this->iPProtocol;
  62. }
  63. /**
  64. * An optional list of ports to which this rule applies. This field is only
  65. * applicable for the UDP or TCP protocol. Each entry must be either an
  66. * integer or a range. If not specified, this rule applies to connections
  67. * through any port.
  68. *
  69. * Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  70. *
  71. * @param string[] $ports
  72. */
  73. public function setPorts($ports)
  74. {
  75. $this->ports = $ports;
  76. }
  77. /**
  78. * @return string[]
  79. */
  80. public function getPorts()
  81. {
  82. return $this->ports;
  83. }
  84. }
  85. // Adding a class alias for backwards compatibility with the previous class name.
  86. class_alias(FirewallAllowed::class, 'Google_Service_Compute_FirewallAllowed');