commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
HttpDestinationModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
21{
22 public const DISCRIMINATOR_VALUE = 'HTTP';
27 protected $type;
28
33 protected $url;
34
39 protected $authentication;
40
41
45 public function __construct(
46 ?string $url = null,
48 ?string $type = null
49 ) {
50 $this->url = $url;
51 $this->authentication = $authentication;
52 $this->type = $type ?? self::DISCRIMINATOR_VALUE;
53 }
54
59 public function getType()
60 {
61 if (is_null($this->type)) {
63 $data = $this->raw(self::FIELD_TYPE);
64 if (is_null($data)) {
65 return null;
66 }
67 $this->type = (string) $data;
68 }
69
70 return $this->type;
71 }
72
79 public function getUrl()
80 {
81 if (is_null($this->url)) {
83 $data = $this->raw(self::FIELD_URL);
84 if (is_null($data)) {
85 return null;
86 }
87 $this->url = (string) $data;
88 }
89
90 return $this->url;
91 }
92
99 public function getAuthentication()
100 {
101 if (is_null($this->authentication)) {
103 $data = $this->raw(self::FIELD_AUTHENTICATION);
104 if (is_null($data)) {
105 return null;
106 }
108 $this->authentication = $className::of($data);
109 }
110
112 }
113
114
118 public function setUrl(?string $url): void
119 {
120 $this->url = $url;
121 }
122
127 {
128 $this->authentication = $authentication;
129 }
130}
__construct(?string $url=null, ?HttpDestinationAuthentication $authentication=null, ?string $type=null)
setAuthentication(?HttpDestinationAuthentication $authentication)