commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
HttpDestinationBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
17 
21 final class HttpDestinationBuilder implements Builder
22 {
27  private $url;
28 
33  private $authentication;
34 
41  public function getUrl()
42  {
43  return $this->url;
44  }
45 
52  public function getAuthentication()
53  {
54  return $this->authentication instanceof HttpDestinationAuthenticationBuilder ? $this->authentication->build() : $this->authentication;
55  }
56 
61  public function withUrl(?string $url)
62  {
63  $this->url = $url;
64 
65  return $this;
66  }
67 
72  public function withAuthentication(?HttpDestinationAuthentication $authentication)
73  {
74  $this->authentication = $authentication;
75 
76  return $this;
77  }
78 
84  {
85  $this->authentication = $authentication;
86 
87  return $this;
88  }
89 
90  public function build(): HttpDestination
91  {
92  return new HttpDestinationModel(
93  $this->url,
94  $this->authentication instanceof HttpDestinationAuthenticationBuilder ? $this->authentication->build() : $this->authentication
95  );
96  }
97 
98  public static function of(): HttpDestinationBuilder
99  {
100  return new self();
101  }
102 }
withAuthenticationBuilder(?HttpDestinationAuthenticationBuilder $authentication)
withAuthentication(?HttpDestinationAuthentication $authentication)