@@ -30,27 +30,50 @@ public function __construct(Adapter $adapter)
3030 * @param string $hostname
3131 * @param string $sslMethod
3232 * @param string $sslType
33- * @param array $sslSettings
33+ * @param array $sslSettings
3434 * @param string $customOriginServer
35- * @param bool $wildcard
35+ * @param bool $wildcard
36+ * @param string $bundleMethod
37+ * @param array $customSsl
3638 * @return \stdClass
3739 */
38- public function addHostname (string $ zoneID , string $ hostname , string $ sslMethod = 'http ' , string $ sslType = 'dv ' , array $ sslSettings = [], string $ customOriginServer = '' , bool $ wildcard = false ): \stdClass
39- {
40+ public function addHostname (
41+ string $ zoneID ,
42+ string $ hostname ,
43+ string $ sslMethod = 'http ' ,
44+ string $ sslType = 'dv ' ,
45+ array $ sslSettings = [],
46+ string $ customOriginServer = '' ,
47+ bool $ wildcard = false ,
48+ string $ bundleMethod = '' ,
49+ array $ customSsl = []
50+ ): \stdClass {
4051 $ options = [
4152 'hostname ' => $ hostname ,
4253 'ssl ' => [
4354 'method ' => $ sslMethod ,
4455 'type ' => $ sslType ,
45- 'settings ' => $ sslSettings
56+ 'settings ' => $ sslSettings ,
57+ 'wildcard ' => $ wildcard ,
4658 ],
47- 'wildcard ' => $ wildcard ,
4859 ];
4960
5061 if (!empty ($ customOriginServer )) {
5162 $ options ['custom_origin_server ' ] = $ customOriginServer ;
5263 }
5364
65+ if (!empty ($ bundleMethod )) {
66+ $ options ['ssl ' ]['bundle_method ' ] = $ bundleMethod ;
67+ }
68+
69+ if (!empty ($ customSsl ['key ' ])) {
70+ $ options ['ssl ' ]['custom_key ' ] = $ customSsl ['key ' ];
71+ }
72+
73+ if (!empty ($ customSsl ['certificate ' ])) {
74+ $ options ['ssl ' ]['custom_certificate ' ] = $ customSsl ['certificate ' ];
75+ }
76+
5477 $ zone = $ this ->adapter ->post ('zones/ ' .$ zoneID .'/custom_hostnames ' , $ options );
5578 $ this ->body = json_decode ($ zone ->getBody ());
5679 return $ this ->body ->result ;
0 commit comments