diff --git a/.fern/metadata.json b/.fern/metadata.json index 3b6284a..2164ad6 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -12,10 +12,9 @@ "homepage": "https://github.com/namedotcom/core-api-php" } }, - "originGitCommit": "c3ab257628a7366dab6a8ad857854de9416d2338", - "originGitCommitIsDirty": true, - "invokedBy": "manual", - "requestedVersion": "1.29.0", - "ciProvider": null, - "sdkVersion": "1.29.0" + "originGitCommitIsDirty": null, + "invokedBy": "ci", + "requestedVersion": "1.31.0", + "ciProvider": "gitlab", + "sdkVersion": "1.31.0" } \ No newline at end of file diff --git a/.fern/replay.lock b/.fern/replay.lock new file mode 100644 index 0000000..77afb74 --- /dev/null +++ b/.fern/replay.lock @@ -0,0 +1,16 @@ +# DO NOT EDIT MANUALLY - Managed by Fern Replay +version: "1.0" +generations: + - commit_sha: 482e3600515d36e036a8718621a8fbd2771862d3 + tree_hash: 7bffd5884e30c5b7e80ecbc1bb16196c682c4059 + timestamp: 2026-07-21T20:06:27.410Z + cli_version: unknown + generator_versions: {} + - commit_sha: 9fe8bd0428e461a8640a32efb10ec0c702475b82 + tree_hash: dfd3f6f3fa09f582bb5178bd3dbbf5c703e4a27e + timestamp: 2026-07-21T20:06:27.758Z + cli_version: unknown + generator_versions: + fernapi/fern-php-sdk: 2.10.15 +current_generation: 9fe8bd0428e461a8640a32efb10ec0c702475b82 +patches: [] diff --git a/.fernignore b/.fernignore index 084a8eb..b8eb8bf 100644 --- a/.fernignore +++ b/.fernignore @@ -1 +1,4 @@ # Specify files that shouldn't be modified by Fern +.fern/replay.lock +.fern/replay.yml +.gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..74928d6 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +.fern/replay.lock linguist-generated=true diff --git a/README.md b/README.md index 6f1314c..65c1ddc 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ The Namecom PHP library provides convenient access to the Namecom APIs from PHP. ## Table of Contents +- [Documentation](#documentation) - [Requirements](#requirements) - [Installation](#installation) - [Usage](#usage) @@ -18,6 +19,10 @@ The Namecom PHP library provides convenient access to the Namecom APIs from PHP. - [Timeouts](#timeouts) - [Contributing](#contributing) +## Documentation + +API reference documentation is available [here](https://docs.name.com). + ## Requirements This SDK requires PHP ^8.1. @@ -38,38 +43,12 @@ Instantiate and use the client with the following: namespace Example; use Namecom\NamecomClient; -use Namecom\Accounts\Requests\CreateAccountRequest; -use Namecom\Types\AccountRequest; -use Namecom\Types\ContactsRequest; -use Namecom\Types\RegistrantContactRequest; $client = new NamecomClient( username: '', password: '', ); -$client->accounts->createAccount( - new CreateAccountRequest([ - 'account' => new AccountRequest([ - 'contacts' => new ContactsRequest([ - 'registrant' => new RegistrantContactRequest([ - 'firstName' => 'Jane', - 'lastName' => 'Doe', - 'address1' => '123 Main St.', - 'city' => 'Denver', - 'state' => 'CO', - 'zip' => '12345', - 'country' => 'US', - 'email' => 'admin@example.net', - 'phone' => '+13035551212', - ]), - ]), - 'accountName' => 'reseller_subaccount', - 'password' => 'SecureP4ss!', - ]), - 'apiTos' => true, - 'tos' => true, - ]), -); +$client->hello(); ``` @@ -78,7 +57,7 @@ $client->accounts->createAccount( This SDK allows you to configure different environments for API requests. ```php -The SDK defaults to the `Default_` environment. To use a different environment, pass it to the client constructor: +The SDK defaults to the `Sandbox` environment. To use a different environment, pass it to the client constructor: ```php use Namecom\NamecomClient; @@ -93,7 +72,8 @@ $client = new NamecomClient( ``` Available environments: -- `Environments::Default_` +- `Environments::Sandbox` +- `Environments::Production` ``` ## Exception Handling @@ -105,7 +85,7 @@ use Namecom\Exceptions\NamecomApiException; use Namecom\Exceptions\NamecomException; try { - $response = $client->accounts->createAccount(...); + $response = $client->hello(...); } catch (NamecomApiException $e) { echo 'API Exception occurred: ' . $e->getMessage() . "\n"; echo 'Status Code: ' . $e->getCode() . "\n"; @@ -164,7 +144,7 @@ The `retryStatusCodes` configuration controls which [5XX](https://developer.mozi Use the `maxRetries` request option to configure this behavior. ```php -$response = $client->accounts->createAccount( +$response = $client->hello( ..., options: [ 'maxRetries' => 0 // Override maxRetries at the request level @@ -177,7 +157,7 @@ $response = $client->accounts->createAccount( The SDK defaults to a 30 second timeout. Use the `timeout` option to configure this behavior. ```php -$response = $client->accounts->createAccount( +$response = $client->hello( ..., options: [ 'timeout' => 3.0 // Override timeout at the request level diff --git a/composer.json b/composer.json index 9a0b503..712f8f2 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "namecom/core-api", - "version": "1.29.0", + "version": "1.31.0", "description": "Official PHP SDK for the name.com Core API", "keywords": [ "namecom", diff --git a/reference.md b/reference.md index 5c0af8f..3244964 100644 --- a/reference.md +++ b/reference.md @@ -1752,7 +1752,12 @@ Adds (registers) a new DNSSEC DS record for a domain. ```php $client->dnsseCs->createDnssec( 'domainName', - new CreateDnssecBody([]), + new CreateDnssecBody([ + 'algorithm' => 1, + 'digest' => 'digest', + 'digestType' => 1, + 'keyTag' => 1, + ]), ); ``` @@ -1776,15 +1781,7 @@ $client->dnsseCs->createDnssec(
-**$algorithm:** `?int` - -
-
- -
-
- -**$digest:** `?string` — Digest is a digest of the DNSKEY RR that is registered with the registry. +**$algorithm:** `int`
@@ -1792,7 +1789,7 @@ $client->dnsseCs->createDnssec(
-**$createDnssecBodyDomainName:** `?string` — The name of the domain. +**$digest:** `string` — Digest is a digest of the DNSKEY RR that is registered with the registry.
@@ -1800,7 +1797,7 @@ $client->dnsseCs->createDnssec(
-**$digestType:** `?int` +**$digestType:** `int`
@@ -1808,7 +1805,7 @@ $client->dnsseCs->createDnssec(
-**$keyTag:** `?int` +**$keyTag:** `int`
@@ -2866,10 +2863,10 @@ Sets up a new URL forwarding (redirect) for a domain or subdomain. If this is th $client->urlForwardings->createUrlForwarding( 'example.com', new CreateUrlForwardingRequest([ - 'body' => new UrlForwarding([ + 'body' => new UrlForwardingInput([ 'forwardsTo' => 'https://destination-site.com', 'host' => 'www', - 'type' => UrlForwardingType::Masked->value, + 'type' => UrlForwardingInputType::Masked->value, ]), ]), ); @@ -2895,7 +2892,7 @@ $client->urlForwardings->createUrlForwarding(
-**$request:** `UrlForwarding` +**$request:** `UrlForwardingInput`
@@ -3003,9 +3000,10 @@ $client->urlForwardings->updateUrlForwarding( 'example.com', 'www.example.org', new UpdateUrlForwardingRequest([ - 'body' => new UpdateUrlForwardingBody([ + 'body' => new UrlForwardingInput([ 'forwardsTo' => 'https://destination-site.com', - 'type' => UrlForwardingType::Masked->value, + 'host' => 'www', + 'type' => UrlForwardingInputType::Masked->value, ]), ]), ); @@ -3039,7 +3037,7 @@ $client->urlForwardings->updateUrlForwarding(
-**$request:** `UpdateUrlForwardingBody` +**$request:** `UrlForwardingInput`
@@ -3353,9 +3351,10 @@ $client->urlForwardings->updateUrlForwardingById( 'example.com', 12345, new UpdateUrlForwardingByIdRequest([ - 'body' => new UpdateUrlForwardingBody([ + 'body' => new UrlForwardingInput([ 'forwardsTo' => 'https://destination-site.com', - 'type' => UrlForwardingType::Masked->value, + 'host' => 'www', + 'type' => UrlForwardingInputType::Masked->value, ]), ]), ); @@ -3389,7 +3388,7 @@ $client->urlForwardings->updateUrlForwardingById(
-**$request:** `UpdateUrlForwardingBody` +**$request:** `UrlForwardingInput`
@@ -3819,9 +3818,11 @@ Supported webhook event names: - `domain.lock.status_change` – domain lock added or removed. - `domain.transfer.status_change` – domain transfer IN to name.com; status updates while name.com is the gaining registrar. - `domain.transfer_out.status_change` – domain transfer OUT from name.com to another registrar; fires when the domain is removed from the account. -- `domain.transfer.internal_in` - name.com domain transfers in to the subscribing account. +- `domain.transfer.internal_in` - name.com domain transfers in to the subscribing account via internal transfer. +- `domain.transfer.internal_out` - name.com domain transfers out of the subscribing account via internal transfer. - `contact.verification.status_change` - contact verification status changes (verified or unverified). - `domain.registry.rejection` – domain **create** failed after asynchronous registry processing (uncommon; most creates succeed at request time). +- `domain.expiration` – domain has expired and entered the post-expiry grace period. This is informational only. diff --git a/src/AccountInfo/AccountInfoClient.php b/src/AccountInfo/AccountInfoClient.php index 7fabd5c..1057f2b 100644 --- a/src/AccountInfo/AccountInfoClient.php +++ b/src/AccountInfo/AccountInfoClient.php @@ -70,7 +70,7 @@ public function checkAccountBalance(?array $options = null): ?CheckAccountBalanc try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/accountinfo/balance", method: HttpMethod::GET, ), diff --git a/src/Accounts/AccountsClient.php b/src/Accounts/AccountsClient.php index a6c8dbc..e62652c 100644 --- a/src/Accounts/AccountsClient.php +++ b/src/Accounts/AccountsClient.php @@ -72,7 +72,7 @@ public function createAccount(CreateAccountRequest $request, ?array $options = n try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/accounts", method: HttpMethod::POST, body: $request, diff --git a/src/ContactVerification/ContactVerificationClient.php b/src/ContactVerification/ContactVerificationClient.php index 51c82d0..cc5a9c0 100644 --- a/src/ContactVerification/ContactVerificationClient.php +++ b/src/ContactVerification/ContactVerificationClient.php @@ -83,7 +83,7 @@ public function unverifiedContactsList(UnverifiedContactsListRequest $request = try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/contacts/unverified", method: HttpMethod::GET, query: $query, @@ -137,7 +137,7 @@ public function verifyContact(int $verificationId, VerifyContactRequest $request try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/contacts/verify/{$verificationId}", method: HttpMethod::POST, headers: $headers, @@ -194,7 +194,7 @@ public function resendContactVerificationEmail(int $verificationId, ResendContac try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/contacts/verify/{$verificationId}:resend", method: HttpMethod::POST, headers: $headers, diff --git a/src/Dns/DnsClient.php b/src/Dns/DnsClient.php index 6817717..af0cd7a 100644 --- a/src/Dns/DnsClient.php +++ b/src/Dns/DnsClient.php @@ -83,7 +83,7 @@ public function listRecords(string $domainName, ListRecordsRequest $request = ne try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}/records", method: HttpMethod::GET, query: $query, @@ -133,7 +133,7 @@ public function createRecord(string $domainName, DnsCreateRecordBody $request, ? try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}/records", method: HttpMethod::POST, body: $request, @@ -183,7 +183,7 @@ public function getRecord(string $domainName, int $id, ?array $options = null): try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}/records/{$id}", method: HttpMethod::GET, ), @@ -233,7 +233,7 @@ public function updateRecord(string $domainName, int $id, DnsUpdateRecordBody $r try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}/records/{$id}", method: HttpMethod::PUT, body: $request, @@ -282,7 +282,7 @@ public function deleteRecord(string $domainName, int $id, ?array $options = null try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}/records/{$id}", method: HttpMethod::DELETE, ), diff --git a/src/DnsseCs/DnsseCsClient.php b/src/DnsseCs/DnsseCsClient.php index c5329e4..87efc9e 100644 --- a/src/DnsseCs/DnsseCsClient.php +++ b/src/DnsseCs/DnsseCsClient.php @@ -73,7 +73,7 @@ public function listDnsseCs(string $domainName, ?array $options = null): ?ListDn try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}/dnssec", method: HttpMethod::GET, ), @@ -116,13 +116,13 @@ public function listDnsseCs(string $domainName, ?array $options = null): ?ListDn * @throws NamecomException * @throws NamecomApiException */ - public function createDnssec(string $domainName, CreateDnssecBody $request = new CreateDnssecBody(), ?array $options = null): ?Dnssec + public function createDnssec(string $domainName, CreateDnssecBody $request, ?array $options = null): ?Dnssec { $options = array_merge($this->options, $options ?? []); try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}/dnssec", method: HttpMethod::POST, body: $request, @@ -172,7 +172,7 @@ public function getDnssec(string $domainName, string $digest, ?array $options = try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}/dnssec/{$digest}", method: HttpMethod::GET, ), @@ -220,7 +220,7 @@ public function deleteDnssec(string $domainName, string $digest, ?array $options try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}/dnssec/{$digest}", method: HttpMethod::DELETE, ), diff --git a/src/DnsseCs/Requests/CreateDnssecBody.php b/src/DnsseCs/Requests/CreateDnssecBody.php index 267c37e..c7375fb 100644 --- a/src/DnsseCs/Requests/CreateDnssecBody.php +++ b/src/DnsseCs/Requests/CreateDnssecBody.php @@ -8,51 +8,43 @@ class CreateDnssecBody extends JsonSerializableType { /** - * @var ?int $algorithm + * @var int $algorithm */ #[JsonProperty('algorithm')] - public ?int $algorithm; + public int $algorithm; /** - * @var ?string $digest Digest is a digest of the DNSKEY RR that is registered with the registry. + * @var string $digest Digest is a digest of the DNSKEY RR that is registered with the registry. */ #[JsonProperty('digest')] - public ?string $digest; + public string $digest; /** - * @var ?string $createDnssecBodyDomainName The name of the domain. - */ - #[JsonProperty('domainName')] - public ?string $createDnssecBodyDomainName; - - /** - * @var ?int $digestType + * @var int $digestType */ #[JsonProperty('digestType')] - public ?int $digestType; + public int $digestType; /** - * @var ?int $keyTag + * @var int $keyTag */ #[JsonProperty('keyTag')] - public ?int $keyTag; + public int $keyTag; /** * @param array{ - * algorithm?: ?int, - * digest?: ?string, - * createDnssecBodyDomainName?: ?string, - * digestType?: ?int, - * keyTag?: ?int, + * algorithm: int, + * digest: string, + * digestType: int, + * keyTag: int, * } $values */ public function __construct( - array $values = [], + array $values, ) { - $this->algorithm = $values['algorithm'] ?? null; - $this->digest = $values['digest'] ?? null; - $this->createDnssecBodyDomainName = $values['createDnssecBodyDomainName'] ?? null; - $this->digestType = $values['digestType'] ?? null; - $this->keyTag = $values['keyTag'] ?? null; + $this->algorithm = $values['algorithm']; + $this->digest = $values['digest']; + $this->digestType = $values['digestType']; + $this->keyTag = $values['keyTag']; } } diff --git a/src/DomainInfo/DomainInfoClient.php b/src/DomainInfo/DomainInfoClient.php index 95cdb42..2d1ac52 100644 --- a/src/DomainInfo/DomainInfoClient.php +++ b/src/DomainInfo/DomainInfoClient.php @@ -74,7 +74,7 @@ public function getRequirement(string $tld, ?array $options = null): ?GetRequire try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domaininfo/requirements/{$tld}", method: HttpMethod::GET, ), @@ -123,7 +123,7 @@ public function checkDomainClaims(string $domain, DomainClaimsCheckRequest $requ try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domaininfo/claims/{$domain}", method: HttpMethod::POST, body: $request, @@ -172,7 +172,7 @@ public function getTldRequirementsV2(string $tld, ?array $options = null): ?Requ try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domaininfo/requirementsV2/{$tld}", method: HttpMethod::GET, ), diff --git a/src/Domains/DomainsClient.php b/src/Domains/DomainsClient.php index 1383f3f..0b2a8b8 100644 --- a/src/Domains/DomainsClient.php +++ b/src/Domains/DomainsClient.php @@ -146,7 +146,7 @@ public function listDomains(ListDomainsRequest $request = new ListDomainsRequest try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains", method: HttpMethod::GET, query: $query, @@ -235,7 +235,7 @@ public function createDomain(CreateDomainRequest $request, ?array $options = nul try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains", method: HttpMethod::POST, headers: $headers, @@ -285,7 +285,7 @@ public function getDomain(string $domainName, ?array $options = null): ?DomainRe try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}", method: HttpMethod::GET, ), @@ -334,7 +334,7 @@ public function updateDomain(string $domainName, UpdateDomainRequest $request, ? try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}", method: HttpMethod::PATCH, body: $request->body, @@ -383,7 +383,7 @@ public function disableAutorenew(string $domainName, ?array $options = null): ?D try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}:disableAutorenew", method: HttpMethod::POST, ), @@ -431,7 +431,7 @@ public function disableWhoisPrivacy(string $domainName, ?array $options = null): try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}:disableWhoisPrivacy", method: HttpMethod::POST, ), @@ -479,7 +479,7 @@ public function enableAutorenew(string $domainName, ?array $options = null): ?Do try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}:enableAutorenew", method: HttpMethod::POST, ), @@ -527,7 +527,7 @@ public function enableWhoisPrivacy(string $domainName, ?array $options = null): try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}:enableWhoisPrivacy", method: HttpMethod::POST, ), @@ -575,7 +575,7 @@ public function getAuthCodeForDomain(string $domainName, ?array $options = null) try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}:getAuthCode", method: HttpMethod::GET, ), @@ -640,7 +640,7 @@ public function getPricingForDomain(string $domainName, GetPricingForDomainReque try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}:getPricing", method: HttpMethod::GET, query: $query, @@ -689,7 +689,7 @@ public function lockDomain(string $domainName, ?array $options = null): ?Domain try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}:lock", method: HttpMethod::POST, ), @@ -742,7 +742,7 @@ public function purchasePrivacy(string $domainName, DomainsPurchasePrivacyBody $ try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}:purchasePrivacy", method: HttpMethod::POST, headers: $headers, @@ -793,7 +793,7 @@ public function renewDomain(string $domainName, DomainsRenewDomainBody $request try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}:renew", method: HttpMethod::POST, body: $request, @@ -845,7 +845,7 @@ public function setContacts(string $domainName, DomainsSetContactsBody $request try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}:setContacts", method: HttpMethod::POST, body: $request, @@ -895,7 +895,7 @@ public function setNameservers(string $domainName, DomainsSetNameserversBody $re try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}:setNameservers", method: HttpMethod::POST, body: $request, @@ -944,7 +944,7 @@ public function unlockDomain(string $domainName, ?array $options = null): ?Domai try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}:unlock", method: HttpMethod::POST, ), @@ -1002,7 +1002,7 @@ public function checkAvailability(AvailabilityRequest $request, ?array $options try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains:checkAvailability", method: HttpMethod::POST, body: $request, @@ -1063,7 +1063,7 @@ public function search(SearchRequest $request, ?array $options = null): ?SearchR try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains:search", method: HttpMethod::POST, body: $request, @@ -1118,7 +1118,7 @@ public function zoneCheck(ZoneCheckRequest $request, ?array $options = null): ?Z try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/zonecheck", method: HttpMethod::POST, body: $request, diff --git a/src/EmailForwardings/EmailForwardingsClient.php b/src/EmailForwardings/EmailForwardingsClient.php index 7976d48..b1e330c 100644 --- a/src/EmailForwardings/EmailForwardingsClient.php +++ b/src/EmailForwardings/EmailForwardingsClient.php @@ -83,7 +83,7 @@ public function listEmailForwardings(string $domainName, ListEmailForwardingsReq try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}/email/forwarding", method: HttpMethod::GET, query: $query, @@ -133,7 +133,7 @@ public function createEmailForwarding(string $domainName, CreateEmailForwardingR try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}/email/forwarding", method: HttpMethod::POST, body: $request, @@ -183,7 +183,7 @@ public function getEmailForwarding(string $domainName, string $emailBox, ?array try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}/email/forwarding/{$emailBox}", method: HttpMethod::GET, ), @@ -233,7 +233,7 @@ public function updateEmailForwarding(string $domainName, string $emailBox, Emai try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}/email/forwarding/{$emailBox}", method: HttpMethod::PUT, body: $request, @@ -282,7 +282,7 @@ public function deleteEmailForwarding(string $domainName, string $emailBox, ?arr try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}/email/forwarding/{$emailBox}", method: HttpMethod::DELETE, ), diff --git a/src/Environments.php b/src/Environments.php index 78013e2..844e054 100644 --- a/src/Environments.php +++ b/src/Environments.php @@ -4,5 +4,6 @@ enum Environments: string { - case Default_ = "https://api.dev.name.com"; + case Sandbox = "https://api.dev.name.com"; + case Production = "https://api.name.com"; } diff --git a/src/NamecomClient.php b/src/NamecomClient.php index ebe37ff..d2be1a9 100644 --- a/src/NamecomClient.php +++ b/src/NamecomClient.php @@ -145,8 +145,8 @@ public function __construct( $defaultHeaders = [ 'X-Fern-Language' => 'PHP', 'X-Fern-SDK-Name' => 'Namecom', - 'X-Fern-SDK-Version' => '1.29.0', - 'User-Agent' => 'namecom/core-api/1.29.0', + 'X-Fern-SDK-Version' => '1.31.0', + 'User-Agent' => 'namecom/core-api/1.31.0', ]; $defaultHeaders['Authorization'] = "Basic " . base64_encode($username . ":" . $password); @@ -200,7 +200,7 @@ public function hello(?array $options = null): ?HelloResponse try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/hello", method: HttpMethod::GET, ), diff --git a/src/Orders/OrdersClient.php b/src/Orders/OrdersClient.php index 7666f57..0ae7ebc 100644 --- a/src/Orders/OrdersClient.php +++ b/src/Orders/OrdersClient.php @@ -101,7 +101,7 @@ public function listOrders(ListOrdersRequest $request = new ListOrdersRequest(), try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/orders", method: HttpMethod::GET, query: $query, @@ -150,7 +150,7 @@ public function getOrder(int $orderId, ?array $options = null): ?Order try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/orders/{$orderId}", method: HttpMethod::GET, ), diff --git a/src/PremiumDomains/PremiumDomainsClient.php b/src/PremiumDomains/PremiumDomainsClient.php index 008c5b7..e64bb32 100644 --- a/src/PremiumDomains/PremiumDomainsClient.php +++ b/src/PremiumDomains/PremiumDomainsClient.php @@ -71,7 +71,7 @@ public function premiumDomainLists(?array $options = null): ?PremiumDomainsDownl try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/premiumdomainslist", method: HttpMethod::GET, ), diff --git a/src/Refunds/RefundsClient.php b/src/Refunds/RefundsClient.php index 4e8908a..d911784 100644 --- a/src/Refunds/RefundsClient.php +++ b/src/Refunds/RefundsClient.php @@ -94,7 +94,7 @@ public function processRefund(RefundRequest $request, ?array $options = null): ? try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/refund", method: HttpMethod::POST, headers: $headers, diff --git a/src/TldPricing/TldPricingClient.php b/src/TldPricing/TldPricingClient.php index 13bc621..203066d 100644 --- a/src/TldPricing/TldPricingClient.php +++ b/src/TldPricing/TldPricingClient.php @@ -94,7 +94,7 @@ public function tldPriceList(TldPriceListRequest $request = new TldPriceListRequ try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/tldpricing", method: HttpMethod::GET, query: $query, diff --git a/src/Transfers/TransfersClient.php b/src/Transfers/TransfersClient.php index 803b1a4..e196483 100644 --- a/src/Transfers/TransfersClient.php +++ b/src/Transfers/TransfersClient.php @@ -86,7 +86,7 @@ public function listTransfers(ListTransfersRequest $request = new ListTransfersR try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/transfers", method: HttpMethod::GET, query: $query, @@ -136,7 +136,7 @@ public function createTransfer(CreateTransferRequest $request, ?array $options = try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/transfers", method: HttpMethod::POST, body: $request, @@ -185,7 +185,7 @@ public function getTransfer(string $domainName, ?array $options = null): ?Transf try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/transfers/{$domainName}", method: HttpMethod::GET, ), @@ -250,7 +250,7 @@ public function cancelTransfer(string $domainName, ?array $options = null): ?Tra try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/transfers/{$domainName}:cancel", method: HttpMethod::POST, ), @@ -299,7 +299,7 @@ public function cancelOutboundTransfer(string $domainName, ?array $options = nul try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/transfers/external/out/{$domainName}:cancel", method: HttpMethod::POST, ), @@ -357,7 +357,7 @@ public function createInternalTransferIn(CreateInternalTransferInRequest $reques try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/transfers/internal/in", method: HttpMethod::POST, body: $request, @@ -416,7 +416,7 @@ public function getTransferEligibility(string $domainName, ?array $options = nul try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/transfers/eligibility/{$domainName}", method: HttpMethod::GET, ), diff --git a/src/Types/AvailableWebhooks.php b/src/Types/AvailableWebhooks.php index 9ce485e..ba4cb23 100644 --- a/src/Types/AvailableWebhooks.php +++ b/src/Types/AvailableWebhooks.php @@ -10,5 +10,7 @@ enum AvailableWebhooks: string case DomainTransferOutStatusChange = "domain.transfer_out.status_change"; case ContactVerificationStatusChange = "contact.verification.status_change"; case DomainTransferInternalIn = "domain.transfer.internal_in"; + case DomainTransferInternalOut = "domain.transfer.internal_out"; case DomainRegistryRejection = "domain.registry.rejection"; + case DomainExpiration = "domain.expiration"; } diff --git a/src/Types/DomainExpiration.php b/src/Types/DomainExpiration.php new file mode 100644 index 0000000..24f2e75 --- /dev/null +++ b/src/Types/DomainExpiration.php @@ -0,0 +1,55 @@ + $eventName The name of the subscription event. + */ + #[JsonProperty('eventName')] + public string $eventName; + + /** + * @var string $domainName The name of the expired domain. + */ + #[JsonProperty('domainName')] + public string $domainName; + + /** + * @var DateTime $expirationDate The date and time when the domain expired. + */ + #[JsonProperty('expirationDate'), Date(Date::TYPE_DATETIME)] + public DateTime $expirationDate; + + /** + * @param array{ + * eventName: value-of, + * domainName: string, + * expirationDate: DateTime, + * } $values + */ + public function __construct( + array $values, + ) { + $this->eventName = $values['eventName']; + $this->domainName = $values['domainName']; + $this->expirationDate = $values['expirationDate']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DomainExpirationEventName.php b/src/Types/DomainExpirationEventName.php new file mode 100644 index 0000000..e298723 --- /dev/null +++ b/src/Types/DomainExpirationEventName.php @@ -0,0 +1,8 @@ + $eventName The name of the subscription event. + */ + #[JsonProperty('eventName')] + public string $eventName; + + /** + * @var ?int $transferId The internal transfer ID for this move, when available. Omitted when no transfer ID has been assigned for the event. + */ + #[JsonProperty('transferId')] + public ?int $transferId; + + /** + * @var int $sourceAccountId The account id that previously owned the domain (the losing account). + */ + #[JsonProperty('sourceAccountId')] + public int $sourceAccountId; + + /** + * @var int $destinationAccountId The account id that now owns the domain (the gaining account). + */ + #[JsonProperty('destinationAccountId')] + public int $destinationAccountId; + + /** + * @var value-of $status + */ + #[JsonProperty('status')] + public string $status; + + /** + * @var DateTime $occurredAt When the domain transfer out occurred. + */ + #[JsonProperty('occurredAt'), Date(Date::TYPE_DATETIME)] + public DateTime $occurredAt; + + /** + * @var DomainResponsePayload $domain + */ + #[JsonProperty('domain')] + public DomainResponsePayload $domain; + + /** + * @param array{ + * eventName: value-of, + * sourceAccountId: int, + * destinationAccountId: int, + * status: value-of, + * occurredAt: DateTime, + * domain: DomainResponsePayload, + * transferId?: ?int, + * } $values + */ + public function __construct( + array $values, + ) { + $this->eventName = $values['eventName']; + $this->transferId = $values['transferId'] ?? null; + $this->sourceAccountId = $values['sourceAccountId']; + $this->destinationAccountId = $values['destinationAccountId']; + $this->status = $values['status']; + $this->occurredAt = $values['occurredAt']; + $this->domain = $values['domain']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DomainTransferInternalOutStatusChangeEventName.php b/src/Types/DomainTransferInternalOutStatusChangeEventName.php new file mode 100644 index 0000000..3731a3b --- /dev/null +++ b/src/Types/DomainTransferInternalOutStatusChangeEventName.php @@ -0,0 +1,8 @@ + $type + * @var value-of $type */ #[JsonProperty('type')] public string $type; @@ -61,9 +55,8 @@ class UpdateUrlForwardingBody extends JsonSerializableType /** * @param array{ * forwardsTo: string, - * type: value-of, - * host?: ?string, - * domainName?: ?string, + * host: string, + * type: value-of, * meta?: ?string, * title?: ?string, * } $values @@ -71,9 +64,8 @@ class UpdateUrlForwardingBody extends JsonSerializableType public function __construct( array $values, ) { - $this->host = $values['host'] ?? null; - $this->domainName = $values['domainName'] ?? null; $this->forwardsTo = $values['forwardsTo']; + $this->host = $values['host']; $this->meta = $values['meta'] ?? null; $this->title = $values['title'] ?? null; $this->type = $values['type']; diff --git a/src/Types/UrlForwardingInputType.php b/src/Types/UrlForwardingInputType.php new file mode 100644 index 0000000..ea38602 --- /dev/null +++ b/src/Types/UrlForwardingInputType.php @@ -0,0 +1,10 @@ +client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}/url/forwarding", method: HttpMethod::GET, query: $query, @@ -135,7 +135,7 @@ public function createUrlForwarding(string $domainName, CreateUrlForwardingReque try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}/url/forwarding", method: HttpMethod::POST, body: $request->body, @@ -185,7 +185,7 @@ public function getUrlForwarding(string $domainName, string $host, ?array $optio try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}/url/forwarding/{$host}", method: HttpMethod::GET, ), @@ -235,7 +235,7 @@ public function updateUrlForwarding(string $domainName, string $host, UpdateUrlF try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}/url/forwarding/{$host}", method: HttpMethod::PUT, body: $request->body, @@ -284,7 +284,7 @@ public function deleteUrlForwarding(string $domainName, string $host, ?array $op try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}/url/forwarding/{$host}", method: HttpMethod::DELETE, ), @@ -334,7 +334,7 @@ public function listUrlForwardingsByDomain(string $domainName, ListUrlForwarding try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/urlforwarding/{$domainName}", method: HttpMethod::GET, query: $query, @@ -384,7 +384,7 @@ public function getUrlForwardingById(string $domainName, int $id, ?array $option try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/urlforwarding/{$domainName}/{$id}", method: HttpMethod::GET, ), @@ -432,7 +432,7 @@ public function deleteUrlForwardingById(string $domainName, int $id, ?array $opt try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/urlforwarding/{$domainName}/{$id}", method: HttpMethod::DELETE, ), @@ -476,7 +476,7 @@ public function updateUrlForwardingById(string $domainName, int $id, UpdateUrlFo try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/urlforwarding/{$domainName}/{$id}", method: HttpMethod::PATCH, body: $request->body, diff --git a/src/VanityNameservers/VanityNameserversClient.php b/src/VanityNameservers/VanityNameserversClient.php index 56f7134..9176aea 100644 --- a/src/VanityNameservers/VanityNameserversClient.php +++ b/src/VanityNameservers/VanityNameserversClient.php @@ -83,7 +83,7 @@ public function listVanityNameservers(string $domainName, ListVanityNameserversR try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}/vanity_nameservers", method: HttpMethod::GET, query: $query, @@ -133,7 +133,7 @@ public function createVanityNameserver(string $domainName, CreateVanityNameserve try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}/vanity_nameservers", method: HttpMethod::POST, body: $request, @@ -183,7 +183,7 @@ public function getVanityNameserver(string $domainName, string $hostname, ?array try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}/vanity_nameservers/{$hostname}", method: HttpMethod::GET, ), @@ -233,7 +233,7 @@ public function updateVanityNameserver(string $domainName, string $hostname, Upd try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}/vanity_nameservers/{$hostname}", method: HttpMethod::PUT, body: $request, @@ -282,7 +282,7 @@ public function deleteVanityNameserver(string $domainName, string $hostname, ?ar try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/domains/{$domainName}/vanity_nameservers/{$hostname}", method: HttpMethod::DELETE, ), diff --git a/src/WebhookNotifications/WebhookNotificationsClient.php b/src/WebhookNotifications/WebhookNotificationsClient.php index 6701b28..1f59055 100644 --- a/src/WebhookNotifications/WebhookNotificationsClient.php +++ b/src/WebhookNotifications/WebhookNotificationsClient.php @@ -74,7 +74,7 @@ public function getSubscribedNotifications(?array $options = null): ?ListSubscri try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/notifications", method: HttpMethod::GET, ), @@ -107,9 +107,11 @@ public function getSubscribedNotifications(?array $options = null): ?ListSubscri * - `domain.lock.status_change` – domain lock added or removed. * - `domain.transfer.status_change` – domain transfer IN to name.com; status updates while name.com is the gaining registrar. * - `domain.transfer_out.status_change` – domain transfer OUT from name.com to another registrar; fires when the domain is removed from the account. - * - `domain.transfer.internal_in` - name.com domain transfers in to the subscribing account. + * - `domain.transfer.internal_in` - name.com domain transfers in to the subscribing account via internal transfer. + * - `domain.transfer.internal_out` - name.com domain transfers out of the subscribing account via internal transfer. * - `contact.verification.status_change` - contact verification status changes (verified or unverified). * - `domain.registry.rejection` – domain **create** failed after asynchronous registry processing (uncommon; most creates succeed at request time). + * - `domain.expiration` – domain has expired and entered the post-expiry grace period. This is informational only. * * @param SubscribeToNotification $request * @param ?array{ @@ -130,7 +132,7 @@ public function subscribeToNotification(SubscribeToNotification $request, ?array try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/notifications", method: HttpMethod::POST, body: $request, @@ -180,7 +182,7 @@ public function modifySubscription(int $id, ModifySubscriptionRequest $request, try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/notifications/{$id}", method: HttpMethod::PUT, body: $request->body, @@ -228,7 +230,7 @@ public function deleteSubscription(int $id, ?array $options = null): void try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Sandbox->value, path: "core/v1/notifications/{$id}", method: HttpMethod::DELETE, ), diff --git a/tests/Wire/DnsseCsWireTest.php b/tests/Wire/DnsseCsWireTest.php index d657a1b..d14e290 100644 --- a/tests/Wire/DnsseCsWireTest.php +++ b/tests/Wire/DnsseCsWireTest.php @@ -40,7 +40,12 @@ public function testCreateDnssec(): void { $testId = 'dnsse_cs.create_dnssec.0'; $this->client->dnsseCs->createDnssec( 'domainName', - new CreateDnssecBody([]), + new CreateDnssecBody([ + 'algorithm' => 1, + 'digest' => 'digest', + 'digestType' => 1, + 'keyTag' => 1, + ]), [ 'headers' => [ 'X-Test-Id' => 'dnsse_cs.create_dnssec.0', diff --git a/tests/Wire/UrlForwardingsWireTest.php b/tests/Wire/UrlForwardingsWireTest.php index c96be1b..e4d15ea 100644 --- a/tests/Wire/UrlForwardingsWireTest.php +++ b/tests/Wire/UrlForwardingsWireTest.php @@ -6,10 +6,9 @@ use Namecom\NamecomClient; use Namecom\UrlForwardings\Requests\ListUrlForwardingsRequest; use Namecom\UrlForwardings\Requests\CreateUrlForwardingRequest; -use Namecom\Types\UrlForwarding; -use Namecom\Types\UrlForwardingType; +use Namecom\Types\UrlForwardingInput; +use Namecom\Types\UrlForwardingInputType; use Namecom\UrlForwardings\Requests\UpdateUrlForwardingRequest; -use Namecom\Types\UpdateUrlForwardingBody; use Namecom\UrlForwardings\Requests\ListUrlForwardingsByDomainRequest; use Namecom\UrlForwardings\Requests\UpdateUrlForwardingByIdRequest; @@ -52,10 +51,10 @@ public function testCreateUrlForwarding(): void { $this->client->urlForwardings->createUrlForwarding( 'example.com', new CreateUrlForwardingRequest([ - 'body' => new UrlForwarding([ + 'body' => new UrlForwardingInput([ 'forwardsTo' => 'https://destination-site.com', 'host' => 'www', - 'type' => UrlForwardingType::Masked->value, + 'type' => UrlForwardingInputType::Masked->value, ]), ]), [ @@ -103,9 +102,10 @@ public function testUpdateUrlForwarding(): void { 'example.com', 'www.example.org', new UpdateUrlForwardingRequest([ - 'body' => new UpdateUrlForwardingBody([ + 'body' => new UrlForwardingInput([ 'forwardsTo' => 'https://destination-site.com', - 'type' => UrlForwardingType::Masked->value, + 'host' => 'www', + 'type' => UrlForwardingInputType::Masked->value, ]), ]), [ @@ -222,9 +222,10 @@ public function testUpdateUrlForwardingById(): void { 'example.com', 12345, new UpdateUrlForwardingByIdRequest([ - 'body' => new UpdateUrlForwardingBody([ + 'body' => new UrlForwardingInput([ 'forwardsTo' => 'https://destination-site.com', - 'type' => UrlForwardingType::Masked->value, + 'host' => 'www', + 'type' => UrlForwardingInputType::Masked->value, ]), ]), [