commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Extension
HttpDestinationModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Extension
;
10
11
use
Commercetools\Base\DateTimeImmutableCollection
;
12
use
Commercetools\Base\JsonObject
;
13
use
Commercetools\Base\JsonObjectModel
;
14
use
Commercetools\Base\MapperFactory
;
15
use stdClass;
16
20
final
class
HttpDestinationModel
extends
JsonObjectModel
implements
HttpDestination
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
,
47
?
HttpDestinationAuthentication
$authentication
=
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
}
107
$className =
HttpDestinationAuthenticationModel::resolveDiscriminatorClass
($data);
108
$this->authentication = $className::of($data);
109
}
110
111
return
$this->authentication
;
112
}
113
114
118
public
function
setUrl
(?
string
$url
): void
119
{
120
$this->url =
$url
;
121
}
122
126
public
function
setAuthentication
(?
HttpDestinationAuthentication
$authentication
): void
127
{
128
$this->authentication =
$authentication
;
129
}
130
}
Commercetools\Api\Models\Extension\HttpDestinationAuthenticationModel\resolveDiscriminatorClass
static resolveDiscriminatorClass($value)
Definition:
HttpDestinationAuthenticationModel.php:73
Commercetools\Api\Models\Extension\HttpDestinationModel
Definition:
HttpDestinationModel.php:21
Commercetools\Api\Models\Extension\HttpDestinationModel\setUrl
setUrl(?string $url)
Definition:
HttpDestinationModel.php:118
Commercetools\Api\Models\Extension\HttpDestinationModel\getType
getType()
Definition:
HttpDestinationModel.php:59
Commercetools\Api\Models\Extension\HttpDestinationModel\__construct
__construct(?string $url=null, ?HttpDestinationAuthentication $authentication=null, ?string $type=null)
Definition:
HttpDestinationModel.php:45
Commercetools\Api\Models\Extension\HttpDestinationModel\getAuthentication
getAuthentication()
Definition:
HttpDestinationModel.php:99
Commercetools\Api\Models\Extension\HttpDestinationModel\$url
$url
Definition:
HttpDestinationModel.php:33
Commercetools\Api\Models\Extension\HttpDestinationModel\$authentication
$authentication
Definition:
HttpDestinationModel.php:39
Commercetools\Api\Models\Extension\HttpDestinationModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
HttpDestinationModel.php:22
Commercetools\Api\Models\Extension\HttpDestinationModel\getUrl
getUrl()
Definition:
HttpDestinationModel.php:79
Commercetools\Api\Models\Extension\HttpDestinationModel\setAuthentication
setAuthentication(?HttpDestinationAuthentication $authentication)
Definition:
HttpDestinationModel.php:126
Commercetools\Api\Models\Extension\HttpDestinationModel\$type
$type
Definition:
HttpDestinationModel.php:27
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition:
BaseJsonObject.php:57
Commercetools\Base\DateTimeImmutableCollection
Definition:
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition:
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition:
MapperFactory.php:16
Commercetools\Api\Models\Extension\HttpDestinationAuthentication
Definition:
HttpDestinationAuthentication.php:15
Commercetools\Api\Models\Extension\HttpDestination
Definition:
HttpDestination.php:15
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Extension
Definition:
AuthorizationHeaderAuthentication.php:9
Generated by
1.9.1