From a6d01a936788c7bf7cf5b895a156b6ccfff34657 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 27 Jan 2022 16:07:34 -0800 Subject: [PATCH] feat: update client libraries to support Database operations (#4938) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: update client libraries to support Database operations PiperOrigin-RevId: 419710013 Source-Link: https://github.com/googleapis/googleapis/commit/b7c9d05c60f87c05c8701e67c6ef24699846a42d Source-Link: https://github.com/googleapis/googleapis-gen/commit/ae498279c4e71cd4aa6e0655e92a693df97472c4 Copy-Tag: eyJwIjoiRG9tYWlucy8uT3dsQm90LnlhbWwiLCJoIjoiYWU0OTgyNzljNGU3MWNkNGFhNmUwNjU1ZTkyYTY5M2RmOTc0NzJjNCJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- Domains/metadata/V1Alpha2/Domains.php | Bin 11659 -> 13231 bytes Domains/metadata/V1Beta1/Domains.php | Bin 11585 -> 13146 bytes .../ConfigureContactSettingsRequest.php | 20 +- .../V1alpha2/ConfigureDnsSettingsRequest.php | 20 +- .../ConfigureManagementSettingsRequest.php | 12 +- Domains/src/V1alpha2/ContactSettings.php | 22 +- .../src/V1alpha2/ContactSettings/Contact.php | 4 +- .../src/V1alpha2/DnsSettings/CustomDns.php | 2 - Domains/src/V1alpha2/DnsSettings/DsRecord.php | 2 - .../DnsSettings/DsRecord/Algorithm.php | 37 ++- .../DnsSettings/DsRecord/DigestType.php | 2 - Domains/src/V1alpha2/DnsSettings/DsState.php | 2 - .../src/V1alpha2/DnsSettings/GlueRecord.php | 2 - .../V1alpha2/DnsSettings/GoogleDomainsDns.php | 2 - Domains/src/V1alpha2/DomainsClient.php | 2 +- Domains/src/V1alpha2/DomainsGrpcClient.php | 91 ++++- .../src/V1alpha2/Gapic/DomainsGapicClient.php | 242 ++++++++++++-- .../ManagementSettings/RenewalMethod.php | 6 +- Domains/src/V1alpha2/OperationMetadata.php | 4 +- .../src/V1alpha2/RegisterDomainRequest.php | 20 +- Domains/src/V1alpha2/RegisterParameters.php | 2 +- .../RegisterParameters/Availability.php | 2 - Domains/src/V1alpha2/Registration.php | 26 +- Domains/src/V1alpha2/Registration/Issue.php | 4 +- Domains/src/V1alpha2/Registration/State.php | 26 +- .../RetrieveRegisterParametersResponse.php | 2 +- .../RetrieveTransferParametersRequest.php | 101 ++++++ .../RetrieveTransferParametersResponse.php | 77 +++++ .../src/V1alpha2/TransferDomainRequest.php | 311 ++++++++++++++++++ Domains/src/V1alpha2/TransferParameters.php | 255 ++++++++++++++ .../V1alpha2/UpdateRegistrationRequest.php | 20 +- Domains/src/V1alpha2/gapic_metadata.json | 10 + .../resources/domains_client_config.json | 10 + .../resources/domains_descriptor_config.php | 10 + .../resources/domains_rest_client_config.php | 85 ++++- .../ConfigureContactSettingsRequest.php | 20 +- .../V1beta1/ConfigureDnsSettingsRequest.php | 20 +- .../ConfigureManagementSettingsRequest.php | 12 +- Domains/src/V1beta1/ContactSettings.php | 22 +- .../src/V1beta1/ContactSettings/Contact.php | 4 +- Domains/src/V1beta1/DnsSettings/CustomDns.php | 2 - Domains/src/V1beta1/DnsSettings/DsRecord.php | 2 - .../DnsSettings/DsRecord/Algorithm.php | 37 ++- .../DnsSettings/DsRecord/DigestType.php | 2 - Domains/src/V1beta1/DnsSettings/DsState.php | 2 - .../src/V1beta1/DnsSettings/GlueRecord.php | 2 - .../V1beta1/DnsSettings/GoogleDomainsDns.php | 2 - Domains/src/V1beta1/DomainsClient.php | 2 +- Domains/src/V1beta1/DomainsGrpcClient.php | 91 ++++- .../src/V1beta1/Gapic/DomainsGapicClient.php | 242 ++++++++++++-- .../ManagementSettings/RenewalMethod.php | 6 +- Domains/src/V1beta1/OperationMetadata.php | 4 +- Domains/src/V1beta1/RegisterDomainRequest.php | 20 +- Domains/src/V1beta1/RegisterParameters.php | 2 +- .../RegisterParameters/Availability.php | 2 - Domains/src/V1beta1/Registration.php | 26 +- Domains/src/V1beta1/Registration/Issue.php | 4 +- Domains/src/V1beta1/Registration/State.php | 26 +- .../RetrieveRegisterParametersResponse.php | 2 +- .../RetrieveTransferParametersRequest.php | 101 ++++++ .../RetrieveTransferParametersResponse.php | 77 +++++ Domains/src/V1beta1/TransferDomainRequest.php | 311 ++++++++++++++++++ Domains/src/V1beta1/TransferParameters.php | 255 ++++++++++++++ .../src/V1beta1/UpdateRegistrationRequest.php | 20 +- Domains/src/V1beta1/gapic_metadata.json | 10 + .../resources/domains_client_config.json | 10 + .../resources/domains_descriptor_config.php | 10 + .../resources/domains_rest_client_config.php | 85 ++++- .../tests/Unit/V1alpha2/DomainsClientTest.php | 260 +++++++++++++++ .../tests/Unit/V1beta1/DomainsClientTest.php | 260 +++++++++++++++ 70 files changed, 3076 insertions(+), 310 deletions(-) create mode 100644 Domains/src/V1alpha2/RetrieveTransferParametersRequest.php create mode 100644 Domains/src/V1alpha2/RetrieveTransferParametersResponse.php create mode 100644 Domains/src/V1alpha2/TransferDomainRequest.php create mode 100644 Domains/src/V1alpha2/TransferParameters.php create mode 100644 Domains/src/V1beta1/RetrieveTransferParametersRequest.php create mode 100644 Domains/src/V1beta1/RetrieveTransferParametersResponse.php create mode 100644 Domains/src/V1beta1/TransferDomainRequest.php create mode 100644 Domains/src/V1beta1/TransferParameters.php diff --git a/Domains/metadata/V1Alpha2/Domains.php b/Domains/metadata/V1Alpha2/Domains.php index ae94db74e29562b291827a5cbdda6c85b28dc902..d89449a6e416bd26002cf9df0b10316efc486b8a 100644 GIT binary patch delta 601 zcmZXQ!E4h{9LIStYiNI6+w`Sss?#NP&aMb<)hUV|Vw1VT>`Gd98CXMo&cK?Cm#ny< ze}ISweISB}c$inkc<|!Q^Yq|BJb6?+h=<|DP6M?f?)K&T`~JRs_}*T8w)FgqfP0t1 zuY!s2!$eq)of7Z{;>&TXlmn@0>9xj;X|?KR&8XJSO9GK0^Vglxt8=Cy4TZ1cB1W6x z8#s&6TaHuj@ng(Cqz=mfqSeqZ7}F9WB4A@y!hAdRa*CuNUX3a(v(l7)B9Z~9Th#@< zX&SYL)ce<%uNu-e3SXp8h}m_}EE+I}c4?E@u78z3Al5Qj$?NWYuk+E)oJk$MW~(`$Sw8qKrU)ya0f$rfT~RlF0ZtsXoG*& g^mN1;txef!RQjkN<0lI$IkIC0-kBH=Zxk}g-r1UQnTv=MF9fu2(vN;IRgQDlWho6v+4*10s)D$@CrQw0g96@ s4b%eK0h0s{CzC%8v$G=)HU_i97d{BHAt6-)0>&D%cq9J;v!Eys3pZgMG5`Po diff --git a/Domains/metadata/V1Beta1/Domains.php b/Domains/metadata/V1Beta1/Domains.php index 6c4f36e17df6eb20470e6e97fff5682746fd7cef..824429d87b60c75a7eeeeb97652f117c05ca5d9c 100644 GIT binary patch delta 644 zcmZ`$F=!KE6z2c0Ig)3RUjB=kTCJB*G_7rFjUuRn*IwElZDP2D4jnv?^iK@byZGNF zkmBMZf}8)?!9^EAsGNdp7X`t^u~WC=P!I=Qs(9K&#Nzhxz3;vEeeZ3pY}Yq;1^oP` z|4Eodm`D6vXj;I}5Wf{R#*-jb4YgF6D;Q?EP}20$yd)4A2LG^gs=idvqyhhBSitD5 z{~9i1^nve1KjJ5tZ^h2a0HRS*i`pd#5fQMqAYr~6do@jB5Y~f{Mq#!p?ISV>P&V{s zwOY_h73urm#0_1OejtA%J}D;FA#G5PHED-dnPt0mevfoU4L_ zB}I_E1K}|_f9kL>^994v-l)3#nBO0gk-*EznQH?I${x8uat+66tkIm;ZP8rOv1xZk z*ikWA1Y)(l+YW24TVB(#&6=}HQ=#8YQ~YjhgughK@HdmiFl=BTy%n|L%=sZm)Y^gD;SneuC-abS+pU(vJi2POShHi*x~UNV zJe(iPLbOXQw$}Z{*Jw)opL2iz_s s4blSI0h8?wCzB`+v$G5jEe5ln7c~g8@*q_L0;U?XNh9|Hvt%gt3QJ8Mg#Z8m diff --git a/Domains/src/V1alpha2/ConfigureContactSettingsRequest.php b/Domains/src/V1alpha2/ConfigureContactSettingsRequest.php index 0d8b52a4523e..a0f670e6cb1f 100644 --- a/Domains/src/V1alpha2/ConfigureContactSettingsRequest.php +++ b/Domains/src/V1alpha2/ConfigureContactSettingsRequest.php @@ -31,14 +31,14 @@ class ConfigureContactSettingsRequest extends \Google\Protobuf\Internal\Message /** * Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the registrant contact is being updated, the - * `update_mask` would be `"registrant_contact"`. + * `update_mask` is `"registrant_contact"`. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; */ private $update_mask = null; /** * The list of contact notices that the caller acknowledges. The notices - * required here depend on the values specified in `contact_settings`. + * needed here depend on the values specified in `contact_settings`. * * Generated from protobuf field repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 4; */ @@ -64,10 +64,10 @@ class ConfigureContactSettingsRequest extends \Google\Protobuf\Internal\Message * @type \Google\Protobuf\FieldMask $update_mask * Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the registrant contact is being updated, the - * `update_mask` would be `"registrant_contact"`. + * `update_mask` is `"registrant_contact"`. * @type int[]|\Google\Protobuf\Internal\RepeatedField $contact_notices * The list of contact notices that the caller acknowledges. The notices - * required here depend on the values specified in `contact_settings`. + * needed here depend on the values specified in `contact_settings`. * @type bool $validate_only * Validate the request without actually updating the contact settings. * } @@ -113,7 +113,7 @@ public function setRegistration($var) */ public function getContactSettings() { - return isset($this->contact_settings) ? $this->contact_settings : null; + return $this->contact_settings; } public function hasContactSettings() @@ -144,14 +144,14 @@ public function setContactSettings($var) /** * Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the registrant contact is being updated, the - * `update_mask` would be `"registrant_contact"`. + * `update_mask` is `"registrant_contact"`. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; * @return \Google\Protobuf\FieldMask|null */ public function getUpdateMask() { - return isset($this->update_mask) ? $this->update_mask : null; + return $this->update_mask; } public function hasUpdateMask() @@ -167,7 +167,7 @@ public function clearUpdateMask() /** * Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the registrant contact is being updated, the - * `update_mask` would be `"registrant_contact"`. + * `update_mask` is `"registrant_contact"`. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; * @param \Google\Protobuf\FieldMask $var @@ -183,7 +183,7 @@ public function setUpdateMask($var) /** * The list of contact notices that the caller acknowledges. The notices - * required here depend on the values specified in `contact_settings`. + * needed here depend on the values specified in `contact_settings`. * * Generated from protobuf field repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 4; * @return \Google\Protobuf\Internal\RepeatedField @@ -195,7 +195,7 @@ public function getContactNotices() /** * The list of contact notices that the caller acknowledges. The notices - * required here depend on the values specified in `contact_settings`. + * needed here depend on the values specified in `contact_settings`. * * Generated from protobuf field repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 4; * @param int[]|\Google\Protobuf\Internal\RepeatedField $var diff --git a/Domains/src/V1alpha2/ConfigureDnsSettingsRequest.php b/Domains/src/V1alpha2/ConfigureDnsSettingsRequest.php index 1506c3f3ad3c..0bd54496257d 100644 --- a/Domains/src/V1alpha2/ConfigureDnsSettingsRequest.php +++ b/Domains/src/V1alpha2/ConfigureDnsSettingsRequest.php @@ -31,12 +31,12 @@ class ConfigureDnsSettingsRequest extends \Google\Protobuf\Internal\Message /** * Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the name servers are being updated for an existing - * Custom DNS configuration, the `update_mask` would be + * Custom DNS configuration, the `update_mask` is * `"custom_dns.name_servers"`. * When changing the DNS provider from one type to another, pass the new * provider's field name as part of the field mask. For example, when changing * from a Google Domains DNS configuration to a Custom DNS configuration, the - * `update_mask` would be `"custom_dns"`. // + * `update_mask` is `"custom_dns"`. // * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; */ @@ -62,12 +62,12 @@ class ConfigureDnsSettingsRequest extends \Google\Protobuf\Internal\Message * @type \Google\Protobuf\FieldMask $update_mask * Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the name servers are being updated for an existing - * Custom DNS configuration, the `update_mask` would be + * Custom DNS configuration, the `update_mask` is * `"custom_dns.name_servers"`. * When changing the DNS provider from one type to another, pass the new * provider's field name as part of the field mask. For example, when changing * from a Google Domains DNS configuration to a Custom DNS configuration, the - * `update_mask` would be `"custom_dns"`. // + * `update_mask` is `"custom_dns"`. // * @type bool $validate_only * Validate the request without actually updating the DNS settings. * } @@ -113,7 +113,7 @@ public function setRegistration($var) */ public function getDnsSettings() { - return isset($this->dns_settings) ? $this->dns_settings : null; + return $this->dns_settings; } public function hasDnsSettings() @@ -144,19 +144,19 @@ public function setDnsSettings($var) /** * Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the name servers are being updated for an existing - * Custom DNS configuration, the `update_mask` would be + * Custom DNS configuration, the `update_mask` is * `"custom_dns.name_servers"`. * When changing the DNS provider from one type to another, pass the new * provider's field name as part of the field mask. For example, when changing * from a Google Domains DNS configuration to a Custom DNS configuration, the - * `update_mask` would be `"custom_dns"`. // + * `update_mask` is `"custom_dns"`. // * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; * @return \Google\Protobuf\FieldMask|null */ public function getUpdateMask() { - return isset($this->update_mask) ? $this->update_mask : null; + return $this->update_mask; } public function hasUpdateMask() @@ -172,12 +172,12 @@ public function clearUpdateMask() /** * Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the name servers are being updated for an existing - * Custom DNS configuration, the `update_mask` would be + * Custom DNS configuration, the `update_mask` is * `"custom_dns.name_servers"`. * When changing the DNS provider from one type to another, pass the new * provider's field name as part of the field mask. For example, when changing * from a Google Domains DNS configuration to a Custom DNS configuration, the - * `update_mask` would be `"custom_dns"`. // + * `update_mask` is `"custom_dns"`. // * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; * @param \Google\Protobuf\FieldMask $var diff --git a/Domains/src/V1alpha2/ConfigureManagementSettingsRequest.php b/Domains/src/V1alpha2/ConfigureManagementSettingsRequest.php index 1d27b9e3af6f..71cb51db71a7 100644 --- a/Domains/src/V1alpha2/ConfigureManagementSettingsRequest.php +++ b/Domains/src/V1alpha2/ConfigureManagementSettingsRequest.php @@ -31,7 +31,7 @@ class ConfigureManagementSettingsRequest extends \Google\Protobuf\Internal\Messa /** * Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the transfer lock is being updated, the `update_mask` - * would be `"transfer_lock_state"`. + * is `"transfer_lock_state"`. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; */ @@ -51,7 +51,7 @@ class ConfigureManagementSettingsRequest extends \Google\Protobuf\Internal\Messa * @type \Google\Protobuf\FieldMask $update_mask * Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the transfer lock is being updated, the `update_mask` - * would be `"transfer_lock_state"`. + * is `"transfer_lock_state"`. * } */ public function __construct($data = NULL) { @@ -95,7 +95,7 @@ public function setRegistration($var) */ public function getManagementSettings() { - return isset($this->management_settings) ? $this->management_settings : null; + return $this->management_settings; } public function hasManagementSettings() @@ -126,14 +126,14 @@ public function setManagementSettings($var) /** * Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the transfer lock is being updated, the `update_mask` - * would be `"transfer_lock_state"`. + * is `"transfer_lock_state"`. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; * @return \Google\Protobuf\FieldMask|null */ public function getUpdateMask() { - return isset($this->update_mask) ? $this->update_mask : null; + return $this->update_mask; } public function hasUpdateMask() @@ -149,7 +149,7 @@ public function clearUpdateMask() /** * Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the transfer lock is being updated, the `update_mask` - * would be `"transfer_lock_state"`. + * is `"transfer_lock_state"`. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; * @param \Google\Protobuf\FieldMask $var diff --git a/Domains/src/V1alpha2/ContactSettings.php b/Domains/src/V1alpha2/ContactSettings.php index 39a606d4afad..362479de59f2 100644 --- a/Domains/src/V1alpha2/ContactSettings.php +++ b/Domains/src/V1alpha2/ContactSettings.php @@ -28,8 +28,8 @@ class ContactSettings extends \Google\Protobuf\Internal\Message * Required. The registrant contact for the `Registration`. * *Caution: Anyone with access to this email address, phone number, * and/or postal address can take control of the domain.* - * *Warning: For new `Registration`s, the registrant will receive an email - * confirmation that they must complete within 14 days to avoid domain + * *Warning: For new `Registration`s, the registrant receives an email + * confirmation that they must complete within 15 days to avoid domain * suspension.* * * Generated from protobuf field .google.cloud.domains.v1alpha2.ContactSettings.Contact registrant_contact = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -60,8 +60,8 @@ class ContactSettings extends \Google\Protobuf\Internal\Message * Required. The registrant contact for the `Registration`. * *Caution: Anyone with access to this email address, phone number, * and/or postal address can take control of the domain.* - * *Warning: For new `Registration`s, the registrant will receive an email - * confirmation that they must complete within 14 days to avoid domain + * *Warning: For new `Registration`s, the registrant receives an email + * confirmation that they must complete within 15 days to avoid domain * suspension.* * @type \Google\Cloud\Domains\V1alpha2\ContactSettings\Contact $admin_contact * Required. The administrative contact for the `Registration`. @@ -104,8 +104,8 @@ public function setPrivacy($var) * Required. The registrant contact for the `Registration`. * *Caution: Anyone with access to this email address, phone number, * and/or postal address can take control of the domain.* - * *Warning: For new `Registration`s, the registrant will receive an email - * confirmation that they must complete within 14 days to avoid domain + * *Warning: For new `Registration`s, the registrant receives an email + * confirmation that they must complete within 15 days to avoid domain * suspension.* * * Generated from protobuf field .google.cloud.domains.v1alpha2.ContactSettings.Contact registrant_contact = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -113,7 +113,7 @@ public function setPrivacy($var) */ public function getRegistrantContact() { - return isset($this->registrant_contact) ? $this->registrant_contact : null; + return $this->registrant_contact; } public function hasRegistrantContact() @@ -130,8 +130,8 @@ public function clearRegistrantContact() * Required. The registrant contact for the `Registration`. * *Caution: Anyone with access to this email address, phone number, * and/or postal address can take control of the domain.* - * *Warning: For new `Registration`s, the registrant will receive an email - * confirmation that they must complete within 14 days to avoid domain + * *Warning: For new `Registration`s, the registrant receives an email + * confirmation that they must complete within 15 days to avoid domain * suspension.* * * Generated from protobuf field .google.cloud.domains.v1alpha2.ContactSettings.Contact registrant_contact = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -154,7 +154,7 @@ public function setRegistrantContact($var) */ public function getAdminContact() { - return isset($this->admin_contact) ? $this->admin_contact : null; + return $this->admin_contact; } public function hasAdminContact() @@ -190,7 +190,7 @@ public function setAdminContact($var) */ public function getTechnicalContact() { - return isset($this->technical_contact) ? $this->technical_contact : null; + return $this->technical_contact; } public function hasTechnicalContact() diff --git a/Domains/src/V1alpha2/ContactSettings/Contact.php b/Domains/src/V1alpha2/ContactSettings/Contact.php index 7830d990b50d..4d12752e6397 100644 --- a/Domains/src/V1alpha2/ContactSettings/Contact.php +++ b/Domains/src/V1alpha2/ContactSettings/Contact.php @@ -73,7 +73,7 @@ public function __construct($data = NULL) { */ public function getPostalAddress() { - return isset($this->postal_address) ? $this->postal_address : null; + return $this->postal_address; } public function hasPostalAddress() @@ -185,6 +185,4 @@ public function setFaxNumber($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Contact::class, \Google\Cloud\Domains\V1alpha2\ContactSettings_Contact::class); diff --git a/Domains/src/V1alpha2/DnsSettings/CustomDns.php b/Domains/src/V1alpha2/DnsSettings/CustomDns.php index 92f63c64e586..6cc0b80f093f 100644 --- a/Domains/src/V1alpha2/DnsSettings/CustomDns.php +++ b/Domains/src/V1alpha2/DnsSettings/CustomDns.php @@ -115,6 +115,4 @@ public function setDsRecords($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CustomDns::class, \Google\Cloud\Domains\V1alpha2\DnsSettings_CustomDns::class); diff --git a/Domains/src/V1alpha2/DnsSettings/DsRecord.php b/Domains/src/V1alpha2/DnsSettings/DsRecord.php index d4eee77b6f28..40a0e38564f2 100644 --- a/Domains/src/V1alpha2/DnsSettings/DsRecord.php +++ b/Domains/src/V1alpha2/DnsSettings/DsRecord.php @@ -169,6 +169,4 @@ public function setDigest($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DsRecord::class, \Google\Cloud\Domains\V1alpha2\DnsSettings_DsRecord::class); diff --git a/Domains/src/V1alpha2/DnsSettings/DsRecord/Algorithm.php b/Domains/src/V1alpha2/DnsSettings/DsRecord/Algorithm.php index ef84cf3036a8..ffecb7ba97e8 100644 --- a/Domains/src/V1alpha2/DnsSettings/DsRecord/Algorithm.php +++ b/Domains/src/V1alpha2/DnsSettings/DsRecord/Algorithm.php @@ -20,6 +20,18 @@ class Algorithm * Generated from protobuf enum ALGORITHM_UNSPECIFIED = 0; */ const ALGORITHM_UNSPECIFIED = 0; + /** + * RSA/MD5. Cannot be used for new deployments. + * + * Generated from protobuf enum RSAMD5 = 1; + */ + const RSAMD5 = 1; + /** + * Diffie-Hellman. Cannot be used for new deployments. + * + * Generated from protobuf enum DH = 2; + */ + const DH = 2; /** * DSA/SHA1. Not recommended for new deployments. * @@ -92,9 +104,29 @@ class Algorithm * Generated from protobuf enum ED448 = 16; */ const ED448 = 16; + /** + * Reserved for Indirect Keys. Cannot be used for new deployments. + * + * Generated from protobuf enum INDIRECT = 252; + */ + const INDIRECT = 252; + /** + * Private algorithm. Cannot be used for new deployments. + * + * Generated from protobuf enum PRIVATEDNS = 253; + */ + const PRIVATEDNS = 253; + /** + * Private algorithm OID. Cannot be used for new deployments. + * + * Generated from protobuf enum PRIVATEOID = 254; + */ + const PRIVATEOID = 254; private static $valueToName = [ self::ALGORITHM_UNSPECIFIED => 'ALGORITHM_UNSPECIFIED', + self::RSAMD5 => 'RSAMD5', + self::DH => 'DH', self::DSA => 'DSA', self::ECC => 'ECC', self::RSASHA1 => 'RSASHA1', @@ -107,6 +139,9 @@ class Algorithm self::ECDSAP384SHA384 => 'ECDSAP384SHA384', self::ED25519 => 'ED25519', self::ED448 => 'ED448', + self::INDIRECT => 'INDIRECT', + self::PRIVATEDNS => 'PRIVATEDNS', + self::PRIVATEOID => 'PRIVATEOID', ]; public static function name($value) @@ -130,6 +165,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Algorithm::class, \Google\Cloud\Domains\V1alpha2\DnsSettings_DsRecord_Algorithm::class); diff --git a/Domains/src/V1alpha2/DnsSettings/DsRecord/DigestType.php b/Domains/src/V1alpha2/DnsSettings/DsRecord/DigestType.php index f01322aa7de1..0230e1fec823 100644 --- a/Domains/src/V1alpha2/DnsSettings/DsRecord/DigestType.php +++ b/Domains/src/V1alpha2/DnsSettings/DsRecord/DigestType.php @@ -74,6 +74,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DigestType::class, \Google\Cloud\Domains\V1alpha2\DnsSettings_DsRecord_DigestType::class); diff --git a/Domains/src/V1alpha2/DnsSettings/DsState.php b/Domains/src/V1alpha2/DnsSettings/DsState.php index 899066f15a66..a96711feba3f 100644 --- a/Domains/src/V1alpha2/DnsSettings/DsState.php +++ b/Domains/src/V1alpha2/DnsSettings/DsState.php @@ -63,6 +63,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DsState::class, \Google\Cloud\Domains\V1alpha2\DnsSettings_DsState::class); diff --git a/Domains/src/V1alpha2/DnsSettings/GlueRecord.php b/Domains/src/V1alpha2/DnsSettings/GlueRecord.php index af2536d62881..c4e29be12377 100644 --- a/Domains/src/V1alpha2/DnsSettings/GlueRecord.php +++ b/Domains/src/V1alpha2/DnsSettings/GlueRecord.php @@ -154,6 +154,4 @@ public function setIpv6Addresses($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(GlueRecord::class, \Google\Cloud\Domains\V1alpha2\DnsSettings_GlueRecord::class); diff --git a/Domains/src/V1alpha2/DnsSettings/GoogleDomainsDns.php b/Domains/src/V1alpha2/DnsSettings/GoogleDomainsDns.php index 1a26d96edbd7..1b14faffe2da 100644 --- a/Domains/src/V1alpha2/DnsSettings/GoogleDomainsDns.php +++ b/Domains/src/V1alpha2/DnsSettings/GoogleDomainsDns.php @@ -160,6 +160,4 @@ public function setDsRecords($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(GoogleDomainsDns::class, \Google\Cloud\Domains\V1alpha2\DnsSettings_GoogleDomainsDns::class); diff --git a/Domains/src/V1alpha2/DomainsClient.php b/Domains/src/V1alpha2/DomainsClient.php index e33d7e68fd1b..ee60888a0bf9 100644 --- a/Domains/src/V1alpha2/DomainsClient.php +++ b/Domains/src/V1alpha2/DomainsClient.php @@ -18,7 +18,7 @@ /* * GENERATED CODE WARNING * Generated by gapic-generator-php from the file - * https://github.com/google/googleapis/blob/master/google/cloud/domains/v1alpha2/domains.proto + * https://github.com/googleapis/googleapis/blob/master/google/cloud/domains/v1alpha2/domains.proto * Updates to the above are reflected here through a refresh process. * * @experimental diff --git a/Domains/src/V1alpha2/DomainsGrpcClient.php b/Domains/src/V1alpha2/DomainsGrpcClient.php index 2ed2020918be..d0ba5e9d988a 100644 --- a/Domains/src/V1alpha2/DomainsGrpcClient.php +++ b/Domains/src/V1alpha2/DomainsGrpcClient.php @@ -94,6 +94,61 @@ public function RegisterDomain(\Google\Cloud\Domains\V1alpha2\RegisterDomainRequ $metadata, $options); } + /** + * Gets parameters needed to transfer a domain name from another registrar to + * Cloud Domains. For domains managed by Google Domains, transferring to Cloud + * Domains is not supported. + * + * + * Use the returned values to call `TransferDomain`. + * @param \Google\Cloud\Domains\V1alpha2\RetrieveTransferParametersRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function RetrieveTransferParameters(\Google\Cloud\Domains\V1alpha2\RetrieveTransferParametersRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.domains.v1alpha2.Domains/RetrieveTransferParameters', + $argument, + ['\Google\Cloud\Domains\V1alpha2\RetrieveTransferParametersResponse', 'decode'], + $metadata, $options); + } + + /** + * Transfers a domain name from another registrar to Cloud Domains. For + * domains managed by Google Domains, transferring to Cloud Domains is not + * supported. + * + * + * Before calling this method, go to the domain's current registrar to unlock + * the domain for transfer and retrieve the domain's transfer authorization + * code. Then call `RetrieveTransferParameters` to confirm that the domain is + * unlocked and to get values needed to build a call to this method. + * + * A successful call creates a `Registration` resource in state + * `TRANSFER_PENDING`. It can take several days to complete the transfer + * process. The registrant can often speed up this process by approving the + * transfer through the current registrar, either by clicking a link in an + * email from the registrar or by visiting the registrar's website. + * + * A few minutes after transfer approval, the resource transitions to state + * `ACTIVE`, indicating that the transfer was successful. If the transfer is + * rejected or the request expires without being approved, the resource can + * end up in state `TRANSFER_FAILED`. If transfer fails, you can safely delete + * the resource and retry the transfer. + * @param \Google\Cloud\Domains\V1alpha2\TransferDomainRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function TransferDomain(\Google\Cloud\Domains\V1alpha2\TransferDomainRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.domains.v1alpha2.Domains/TransferDomain', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + /** * Lists the `Registration` resources in a project. * @param \Google\Cloud\Domains\V1alpha2\ListRegistrationsRequest $argument input argument @@ -191,20 +246,15 @@ public function ConfigureContactSettings(\Google\Cloud\Domains\V1alpha2\Configur } /** - * Exports a `Registration` that you no longer want to use with - * Cloud Domains. You can continue to use the domain in - * [Google Domains](https://domains.google/) until it expires. + * Exports a `Registration` resource, such that it is no longer managed by + * Cloud Domains. * - * If the export is successful: - * - * * The resource's `state` becomes `EXPORTED`, meaning that it is no longer - * managed by Cloud Domains - * * Because individual users can own domains in Google Domains, the calling - * user becomes the domain's sole owner. Permissions for the domain are - * subsequently managed in Google Domains. - * * Without further action, the domain does not renew automatically. - * The new owner can set up billing in Google Domains to renew the domain - * if needed. + * When an active domain is successfully exported, you can continue to use the + * domain in [Google Domains](https://domains.google/) until it expires. The + * calling user becomes the domain's sole owner in Google Domains, and + * permissions for the domain are subsequently managed there. The domain does + * not renew automatically unless the new owner sets up billing in Google + * Domains. * @param \Google\Cloud\Domains\V1alpha2\ExportRegistrationRequest $argument input argument * @param array $metadata metadata * @param array $options call options @@ -221,10 +271,23 @@ public function ExportRegistration(\Google\Cloud\Domains\V1alpha2\ExportRegistra /** * Deletes a `Registration` resource. * - * This method only works on resources in one of the following states: + * This method works on any `Registration` resource using [Subscription or + * Commitment billing](https://cloud.google.com/domains/pricing#billing-models), provided that the + * resource was created at least 1 day in the past. + * + * For `Registration` resources using + * [Monthly billing](https://cloud.google.com/domains/pricing#billing-models), this method works if: * * * `state` is `EXPORTED` with `expire_time` in the past * * `state` is `REGISTRATION_FAILED` + * * `state` is `TRANSFER_FAILED` + * + * When an active registration is successfully deleted, you can continue to + * use the domain in [Google Domains](https://domains.google/) until it + * expires. The calling user becomes the domain's sole owner in Google + * Domains, and permissions for the domain are subsequently managed there. The + * domain does not renew automatically unless the new owner sets up billing in + * Google Domains. * @param \Google\Cloud\Domains\V1alpha2\DeleteRegistrationRequest $argument input argument * @param array $metadata metadata * @param array $options call options diff --git a/Domains/src/V1alpha2/Gapic/DomainsGapicClient.php b/Domains/src/V1alpha2/Gapic/DomainsGapicClient.php index 700effcb4935..1fe77d14606e 100644 --- a/Domains/src/V1alpha2/Gapic/DomainsGapicClient.php +++ b/Domains/src/V1alpha2/Gapic/DomainsGapicClient.php @@ -18,7 +18,7 @@ /* * GENERATED CODE WARNING * Generated by gapic-generator-php from the file - * https://github.com/google/googleapis/blob/master/google/cloud/domains/v1alpha2/domains.proto + * https://github.com/googleapis/googleapis/blob/master/google/cloud/domains/v1alpha2/domains.proto * Updates to the above are reflected here through a refresh process. * * @experimental @@ -59,8 +59,11 @@ use Google\Cloud\Domains\V1alpha2\RetrieveAuthorizationCodeRequest; use Google\Cloud\Domains\V1alpha2\RetrieveRegisterParametersRequest; use Google\Cloud\Domains\V1alpha2\RetrieveRegisterParametersResponse; +use Google\Cloud\Domains\V1alpha2\RetrieveTransferParametersRequest; +use Google\Cloud\Domains\V1alpha2\RetrieveTransferParametersResponse; use Google\Cloud\Domains\V1alpha2\SearchDomainsRequest; use Google\Cloud\Domains\V1alpha2\SearchDomainsResponse; +use Google\Cloud\Domains\V1alpha2\TransferDomainRequest; use Google\Cloud\Domains\V1alpha2\UpdateRegistrationRequest; use Google\LongRunning\Operation; use Google\Protobuf\FieldMask; @@ -109,9 +112,9 @@ * ``` * * Many parameters require resource names to be formatted in a particular way. To - * assistwith these names, this class includes a format method for each type of - * name, and additionallya parseName method to extract the individual identifiers - * contained within formatted namesthat are returned by the API. + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. * * @experimental */ @@ -370,6 +373,9 @@ public function resumeOperation($operationName, $methodName = null) * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. * } * * @throws ValidationException @@ -428,7 +434,7 @@ public function __construct(array $options = []) * in the format `projects/*/locations/*/registrations/*`. * @param FieldMask $updateMask Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the registrant contact is being updated, the - * `update_mask` would be `"registrant_contact"`. + * `update_mask` is `"registrant_contact"`. * @param array $optionalArgs { * Optional. * @@ -436,7 +442,7 @@ public function __construct(array $options = []) * Fields of the `ContactSettings` to update. * @type int[] $contactNotices * The list of contact notices that the caller acknowledges. The notices - * required here depend on the values specified in `contact_settings`. + * needed here depend on the values specified in `contact_settings`. * For allowed values, use constants defined on {@see \Google\Cloud\Domains\V1alpha2\ContactNotice} * @type bool $validateOnly * Validate the request without actually updating the contact settings. @@ -521,13 +527,13 @@ public function configureContactSettings($registration, $updateMask, array $opti * in the format `projects/*/locations/*/registrations/*`. * @param FieldMask $updateMask Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the name servers are being updated for an existing - * Custom DNS configuration, the `update_mask` would be + * Custom DNS configuration, the `update_mask` is * `"custom_dns.name_servers"`. * * When changing the DNS provider from one type to another, pass the new * provider's field name as part of the field mask. For example, when changing * from a Google Domains DNS configuration to a Custom DNS configuration, the - * `update_mask` would be `"custom_dns"`. // + * `update_mask` is `"custom_dns"`. // * @param array $optionalArgs { * Optional. * @@ -612,7 +618,7 @@ public function configureDnsSettings($registration, $updateMask, array $optional * in the format `projects/*/locations/*/registrations/*`. * @param FieldMask $updateMask Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the transfer lock is being updated, the `update_mask` - * would be `"transfer_lock_state"`. + * is `"transfer_lock_state"`. * @param array $optionalArgs { * Optional. * @@ -650,10 +656,23 @@ public function configureManagementSettings($registration, $updateMask, array $o /** * Deletes a `Registration` resource. * - * This method only works on resources in one of the following states: + * This method works on any `Registration` resource using [Subscription or + * Commitment billing](https://cloud.google.com/domains/pricing#billing-models), provided that the + * resource was created at least 1 day in the past. + * + * For `Registration` resources using + * [Monthly billing](https://cloud.google.com/domains/pricing#billing-models), this method works if: * * * `state` is `EXPORTED` with `expire_time` in the past * * `state` is `REGISTRATION_FAILED` + * * `state` is `TRANSFER_FAILED` + * + * When an active registration is successfully deleted, you can continue to + * use the domain in [Google Domains](https://domains.google/) until it + * expires. The calling user becomes the domain's sole owner in Google + * Domains, and permissions for the domain are subsequently managed there. The + * domain does not renew automatically unless the new owner sets up billing in + * Google Domains. * * Sample code: * ``` @@ -719,20 +738,15 @@ public function deleteRegistration($name, array $optionalArgs = []) } /** - * Exports a `Registration` that you no longer want to use with - * Cloud Domains. You can continue to use the domain in - * [Google Domains](https://domains.google/) until it expires. - * - * If the export is successful: + * Exports a `Registration` resource, such that it is no longer managed by + * Cloud Domains. * - * * The resource's `state` becomes `EXPORTED`, meaning that it is no longer - * managed by Cloud Domains - * * Because individual users can own domains in Google Domains, the calling - * user becomes the domain's sole owner. Permissions for the domain are - * subsequently managed in Google Domains. - * * Without further action, the domain does not renew automatically. - * The new owner can set up billing in Google Domains to renew the domain - * if needed. + * When an active domain is successfully exported, you can continue to use the + * domain in [Google Domains](https://domains.google/) until it expires. The + * calling user becomes the domain's sole owner in Google Domains, and + * permissions for the domain are subsequently managed there. The domain does + * not renew automatically unless the new owner sets up billing in Google + * Domains. * * Sample code: * ``` @@ -1003,11 +1017,11 @@ public function listRegistrations($parent, array $optionalArgs = []) * For allowed values, use constants defined on {@see \Google\Cloud\Domains\V1alpha2\DomainNotice} * @type int[] $contactNotices * The list of contact notices that the caller acknowledges. The notices - * required here depend on the values specified in + * needed here depend on the values specified in * `registration.contact_settings`. * For allowed values, use constants defined on {@see \Google\Cloud\Domains\V1alpha2\ContactNotice} * @type bool $validateOnly - * When true, only validation will be performed, without actually registering + * When true, only validation is performed, without actually registering * the domain. Follows: * https://cloud.google.com/apis/design/design_patterns#request_validation * @type RetrySettings|array $retrySettings @@ -1187,6 +1201,56 @@ public function retrieveRegisterParameters($domainName, $location, array $option return $this->startCall('RetrieveRegisterParameters', RetrieveRegisterParametersResponse::class, $optionalArgs, $request)->wait(); } + /** + * Gets parameters needed to transfer a domain name from another registrar to + * Cloud Domains. For domains managed by Google Domains, transferring to Cloud + * Domains is not supported. + * + * + * Use the returned values to call `TransferDomain`. + * + * Sample code: + * ``` + * $domainsClient = new DomainsClient(); + * try { + * $domainName = 'domain_name'; + * $formattedLocation = $domainsClient->locationName('[PROJECT]', '[LOCATION]'); + * $response = $domainsClient->retrieveTransferParameters($domainName, $formattedLocation); + * } finally { + * $domainsClient->close(); + * } + * ``` + * + * @param string $domainName Required. The domain name. Unicode domain names must be expressed in Punycode format. + * @param string $location Required. The location. Must be in the format `projects/*/locations/*`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Domains\V1alpha2\RetrieveTransferParametersResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function retrieveTransferParameters($domainName, $location, array $optionalArgs = []) + { + $request = new RetrieveTransferParametersRequest(); + $requestParamHeaders = []; + $request->setDomainName($domainName); + $request->setLocation($location); + $requestParamHeaders['location'] = $location; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('RetrieveTransferParameters', RetrieveTransferParametersResponse::class, $optionalArgs, $request)->wait(); + } + /** * Searches for available domain names similar to the provided query. * @@ -1236,6 +1300,130 @@ public function searchDomains($query, $location, array $optionalArgs = []) return $this->startCall('SearchDomains', SearchDomainsResponse::class, $optionalArgs, $request)->wait(); } + /** + * Transfers a domain name from another registrar to Cloud Domains. For + * domains managed by Google Domains, transferring to Cloud Domains is not + * supported. + * + * + * Before calling this method, go to the domain's current registrar to unlock + * the domain for transfer and retrieve the domain's transfer authorization + * code. Then call `RetrieveTransferParameters` to confirm that the domain is + * unlocked and to get values needed to build a call to this method. + * + * A successful call creates a `Registration` resource in state + * `TRANSFER_PENDING`. It can take several days to complete the transfer + * process. The registrant can often speed up this process by approving the + * transfer through the current registrar, either by clicking a link in an + * email from the registrar or by visiting the registrar's website. + * + * A few minutes after transfer approval, the resource transitions to state + * `ACTIVE`, indicating that the transfer was successful. If the transfer is + * rejected or the request expires without being approved, the resource can + * end up in state `TRANSFER_FAILED`. If transfer fails, you can safely delete + * the resource and retry the transfer. + * + * Sample code: + * ``` + * $domainsClient = new DomainsClient(); + * try { + * $formattedParent = $domainsClient->locationName('[PROJECT]', '[LOCATION]'); + * $registration = new Registration(); + * $yearlyPrice = new Money(); + * $operationResponse = $domainsClient->transferDomain($formattedParent, $registration, $yearlyPrice); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $domainsClient->transferDomain($formattedParent, $registration, $yearlyPrice); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $domainsClient->resumeOperation($operationName, 'transferDomain'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $domainsClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource of the `Registration`. Must be in the + * format `projects/*/locations/*`. + * @param Registration $registration Required. The complete `Registration` resource to be created. + * + * You can leave `registration.dns_settings` unset to import the + * domain's current DNS configuration from its current registrar. Use this + * option only if you are sure that the domain's current DNS service + * does not cease upon transfer, as is often the case for DNS services + * provided for free by the registrar. + * @param Money $yearlyPrice Required. Acknowledgement of the price to transfer or renew the domain for one year. + * Call `RetrieveTransferParameters` to obtain the price, which you must + * acknowledge. + * @param array $optionalArgs { + * Optional. + * + * @type int[] $contactNotices + * The list of contact notices that you acknowledge. The notices + * needed here depend on the values specified in + * `registration.contact_settings`. + * For allowed values, use constants defined on {@see \Google\Cloud\Domains\V1alpha2\ContactNotice} + * @type AuthorizationCode $authorizationCode + * The domain's transfer authorization code. You can obtain this from the + * domain's current registrar. + * @type bool $validateOnly + * Validate the request without actually transferring the domain. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function transferDomain($parent, $registration, $yearlyPrice, array $optionalArgs = []) + { + $request = new TransferDomainRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setRegistration($registration); + $request->setYearlyPrice($yearlyPrice); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['contactNotices'])) { + $request->setContactNotices($optionalArgs['contactNotices']); + } + + if (isset($optionalArgs['authorizationCode'])) { + $request->setAuthorizationCode($optionalArgs['authorizationCode']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('TransferDomain', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + /** * Updates select fields of a `Registration` resource, notably `labels`. To * update other fields, use the appropriate custom update method: @@ -1281,8 +1469,8 @@ public function searchDomains($query, $location, array $optionalArgs = []) * ``` * * @param FieldMask $updateMask Required. The field mask describing which fields to update as a comma-separated list. - * For example, if only the labels are being updated, the `update_mask` would - * be `"labels"`. + * For example, if only the labels are being updated, the `update_mask` is + * `"labels"`. * @param array $optionalArgs { * Optional. * diff --git a/Domains/src/V1alpha2/ManagementSettings/RenewalMethod.php b/Domains/src/V1alpha2/ManagementSettings/RenewalMethod.php index 130eb4e3a25f..a7b8a07ee7b6 100644 --- a/Domains/src/V1alpha2/ManagementSettings/RenewalMethod.php +++ b/Domains/src/V1alpha2/ManagementSettings/RenewalMethod.php @@ -21,8 +21,8 @@ class RenewalMethod const RENEWAL_METHOD_UNSPECIFIED = 0; /** * The domain is automatically renewed each year . - * To disable automatic renewals, export the domain by calling - * `ExportRegistration` . + * To disable automatic renewals, delete the resource by calling + * `DeleteRegistration` or export it by calling `ExportRegistration`. * * Generated from protobuf enum AUTOMATIC_RENEWAL = 1; */ @@ -65,6 +65,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RenewalMethod::class, \Google\Cloud\Domains\V1alpha2\ManagementSettings_RenewalMethod::class); diff --git a/Domains/src/V1alpha2/OperationMetadata.php b/Domains/src/V1alpha2/OperationMetadata.php index 715863b3b44e..b125afa0cd0e 100644 --- a/Domains/src/V1alpha2/OperationMetadata.php +++ b/Domains/src/V1alpha2/OperationMetadata.php @@ -85,7 +85,7 @@ public function __construct($data = NULL) { */ public function getCreateTime() { - return isset($this->create_time) ? $this->create_time : null; + return $this->create_time; } public function hasCreateTime() @@ -121,7 +121,7 @@ public function setCreateTime($var) */ public function getEndTime() { - return isset($this->end_time) ? $this->end_time : null; + return $this->end_time; } public function hasEndTime() diff --git a/Domains/src/V1alpha2/RegisterDomainRequest.php b/Domains/src/V1alpha2/RegisterDomainRequest.php index 1d4971867451..906da60c8297 100644 --- a/Domains/src/V1alpha2/RegisterDomainRequest.php +++ b/Domains/src/V1alpha2/RegisterDomainRequest.php @@ -37,7 +37,7 @@ class RegisterDomainRequest extends \Google\Protobuf\Internal\Message private $domain_notices; /** * The list of contact notices that the caller acknowledges. The notices - * required here depend on the values specified in + * needed here depend on the values specified in * `registration.contact_settings`. * * Generated from protobuf field repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 4; @@ -52,7 +52,7 @@ class RegisterDomainRequest extends \Google\Protobuf\Internal\Message */ private $yearly_price = null; /** - * When true, only validation will be performed, without actually registering + * When true, only validation is performed, without actually registering * the domain. Follows: * https://cloud.google.com/apis/design/design_patterns#request_validation * @@ -76,14 +76,14 @@ class RegisterDomainRequest extends \Google\Protobuf\Internal\Message * `RetrieveRegisterParameters` to see the notices that need acknowledgement. * @type int[]|\Google\Protobuf\Internal\RepeatedField $contact_notices * The list of contact notices that the caller acknowledges. The notices - * required here depend on the values specified in + * needed here depend on the values specified in * `registration.contact_settings`. * @type \Google\Type\Money $yearly_price * Required. Yearly price to register or renew the domain. * The value that should be put here can be obtained from * RetrieveRegisterParameters or SearchDomains calls. * @type bool $validate_only - * When true, only validation will be performed, without actually registering + * When true, only validation is performed, without actually registering * the domain. Follows: * https://cloud.google.com/apis/design/design_patterns#request_validation * } @@ -129,7 +129,7 @@ public function setParent($var) */ public function getRegistration() { - return isset($this->registration) ? $this->registration : null; + return $this->registration; } public function hasRegistration() @@ -187,7 +187,7 @@ public function setDomainNotices($var) /** * The list of contact notices that the caller acknowledges. The notices - * required here depend on the values specified in + * needed here depend on the values specified in * `registration.contact_settings`. * * Generated from protobuf field repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 4; @@ -200,7 +200,7 @@ public function getContactNotices() /** * The list of contact notices that the caller acknowledges. The notices - * required here depend on the values specified in + * needed here depend on the values specified in * `registration.contact_settings`. * * Generated from protobuf field repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 4; @@ -225,7 +225,7 @@ public function setContactNotices($var) */ public function getYearlyPrice() { - return isset($this->yearly_price) ? $this->yearly_price : null; + return $this->yearly_price; } public function hasYearlyPrice() @@ -256,7 +256,7 @@ public function setYearlyPrice($var) } /** - * When true, only validation will be performed, without actually registering + * When true, only validation is performed, without actually registering * the domain. Follows: * https://cloud.google.com/apis/design/design_patterns#request_validation * @@ -269,7 +269,7 @@ public function getValidateOnly() } /** - * When true, only validation will be performed, without actually registering + * When true, only validation is performed, without actually registering * the domain. Follows: * https://cloud.google.com/apis/design/design_patterns#request_validation * diff --git a/Domains/src/V1alpha2/RegisterParameters.php b/Domains/src/V1alpha2/RegisterParameters.php index 9132462c415b..241ae2d4d7d7 100644 --- a/Domains/src/V1alpha2/RegisterParameters.php +++ b/Domains/src/V1alpha2/RegisterParameters.php @@ -189,7 +189,7 @@ public function setDomainNotices($var) */ public function getYearlyPrice() { - return isset($this->yearly_price) ? $this->yearly_price : null; + return $this->yearly_price; } public function hasYearlyPrice() diff --git a/Domains/src/V1alpha2/RegisterParameters/Availability.php b/Domains/src/V1alpha2/RegisterParameters/Availability.php index 75cebb5a5131..057a63cfe3c5 100644 --- a/Domains/src/V1alpha2/RegisterParameters/Availability.php +++ b/Domains/src/V1alpha2/RegisterParameters/Availability.php @@ -76,6 +76,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Availability::class, \Google\Cloud\Domains\V1alpha2\RegisterParameters_Availability::class); diff --git a/Domains/src/V1alpha2/Registration.php b/Domains/src/V1alpha2/Registration.php index 6ff5b84b1bb3..ca14be7f89eb 100644 --- a/Domains/src/V1alpha2/Registration.php +++ b/Domains/src/V1alpha2/Registration.php @@ -11,11 +11,17 @@ /** * The `Registration` resource facilitates managing and configuring domain name * registrations. + * There are several ways to create a new `Registration` resource: * To create a new `Registration` resource, find a suitable domain name by * calling the `SearchDomains` method with a query to see available domain name * options. After choosing a name, call `RetrieveRegisterParameters` to * ensure availability and obtain information like pricing, which is needed to * build a call to `RegisterDomain`. + * Another way to create a new `Registration` is to transfer an existing + * domain from another registrar. First, go to the current registrar to unlock + * the domain for transfer and retrieve the domain's transfer authorization + * code. Then call `RetrieveTransferParameters` to confirm that the domain is + * unlocked and to get values needed to build a call to `TransferDomain`. * * Generated from protobuf message google.cloud.domains.v1alpha2.Registration */ @@ -94,7 +100,7 @@ class Registration extends \Google\Protobuf\Internal\Message * `contact_settings` field that change its `registrant_contact` or `privacy` * fields require email confirmation by the `registrant_contact` * before taking effect. This field is set only if there are pending updates - * to the `contact_settings` that have not yet been confirmed. To confirm the + * to the `contact_settings` that have not been confirmed. To confirm the * changes, the `registrant_contact` must follow the instructions in the * email they receive. * @@ -148,7 +154,7 @@ class Registration extends \Google\Protobuf\Internal\Message * `contact_settings` field that change its `registrant_contact` or `privacy` * fields require email confirmation by the `registrant_contact` * before taking effect. This field is set only if there are pending updates - * to the `contact_settings` that have not yet been confirmed. To confirm the + * to the `contact_settings` that have not been confirmed. To confirm the * changes, the `registrant_contact` must follow the instructions in the * email they receive. * @type int[]|\Google\Protobuf\Internal\RepeatedField $supported_privacy @@ -223,7 +229,7 @@ public function setDomainName($var) */ public function getCreateTime() { - return isset($this->create_time) ? $this->create_time : null; + return $this->create_time; } public function hasCreateTime() @@ -259,7 +265,7 @@ public function setCreateTime($var) */ public function getExpireTime() { - return isset($this->expire_time) ? $this->expire_time : null; + return $this->expire_time; } public function hasExpireTime() @@ -376,7 +382,7 @@ public function setLabels($var) */ public function getManagementSettings() { - return isset($this->management_settings) ? $this->management_settings : null; + return $this->management_settings; } public function hasManagementSettings() @@ -417,7 +423,7 @@ public function setManagementSettings($var) */ public function getDnsSettings() { - return isset($this->dns_settings) ? $this->dns_settings : null; + return $this->dns_settings; } public function hasDnsSettings() @@ -457,7 +463,7 @@ public function setDnsSettings($var) */ public function getContactSettings() { - return isset($this->contact_settings) ? $this->contact_settings : null; + return $this->contact_settings; } public function hasContactSettings() @@ -492,7 +498,7 @@ public function setContactSettings($var) * `contact_settings` field that change its `registrant_contact` or `privacy` * fields require email confirmation by the `registrant_contact` * before taking effect. This field is set only if there are pending updates - * to the `contact_settings` that have not yet been confirmed. To confirm the + * to the `contact_settings` that have not been confirmed. To confirm the * changes, the `registrant_contact` must follow the instructions in the * email they receive. * @@ -501,7 +507,7 @@ public function setContactSettings($var) */ public function getPendingContactSettings() { - return isset($this->pending_contact_settings) ? $this->pending_contact_settings : null; + return $this->pending_contact_settings; } public function hasPendingContactSettings() @@ -519,7 +525,7 @@ public function clearPendingContactSettings() * `contact_settings` field that change its `registrant_contact` or `privacy` * fields require email confirmation by the `registrant_contact` * before taking effect. This field is set only if there are pending updates - * to the `contact_settings` that have not yet been confirmed. To confirm the + * to the `contact_settings` that have not been confirmed. To confirm the * changes, the `registrant_contact` must follow the instructions in the * email they receive. * diff --git a/Domains/src/V1alpha2/Registration/Issue.php b/Domains/src/V1alpha2/Registration/Issue.php index f454f351cded..458fcf8779f0 100644 --- a/Domains/src/V1alpha2/Registration/Issue.php +++ b/Domains/src/V1alpha2/Registration/Issue.php @@ -31,7 +31,7 @@ class Issue * verify the email address, follow the * instructions in the email the `registrant_contact` receives following * registration. If you do not complete email verification within - * 14 days of registration, the domain is suspended. To resend the + * 15 days of registration, the domain is suspended. To resend the * verification email, call ConfigureContactSettings and provide the current * `registrant_contact.email`. * @@ -66,6 +66,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Issue::class, \Google\Cloud\Domains\V1alpha2\Registration_Issue::class); diff --git a/Domains/src/V1alpha2/Registration/State.php b/Domains/src/V1alpha2/Registration/State.php index d6da7716d130..d93409e88bab 100644 --- a/Domains/src/V1alpha2/Registration/State.php +++ b/Domains/src/V1alpha2/Registration/State.php @@ -32,6 +32,20 @@ class State * Generated from protobuf enum REGISTRATION_FAILED = 2; */ const REGISTRATION_FAILED = 2; + /** + * The domain is being transferred from another registrar to Cloud Domains. + * + * Generated from protobuf enum TRANSFER_PENDING = 3; + */ + const TRANSFER_PENDING = 3; + /** + * The attempt to transfer the domain from another registrar to + * Cloud Domains failed. You can delete resources in this state and retry + * the transfer. + * + * Generated from protobuf enum TRANSFER_FAILED = 4; + */ + const TRANSFER_FAILED = 4; /** * The domain is registered and operational. The domain renews automatically * as long as it remains in this state. @@ -47,11 +61,11 @@ class State */ const SUSPENDED = 7; /** - * The domain has been exported from Cloud Domains to + * The domain is no longer managed with Cloud Domains. It may have been + * transferred to another registrar or exported for management in * [Google Domains](https://domains.google/). You can no longer update it - * with this API, and information shown about it may be stale. Without further action, domains in this - * state expire at their `expire_time`. You can delete the resource - * after the `expire_time` has passed. + * with this API, and information shown about it may be stale. Domains in + * this state are not automatically renewed by Cloud Domains. * * Generated from protobuf enum EXPORTED = 8; */ @@ -61,6 +75,8 @@ class State self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', self::REGISTRATION_PENDING => 'REGISTRATION_PENDING', self::REGISTRATION_FAILED => 'REGISTRATION_FAILED', + self::TRANSFER_PENDING => 'TRANSFER_PENDING', + self::TRANSFER_FAILED => 'TRANSFER_FAILED', self::ACTIVE => 'ACTIVE', self::SUSPENDED => 'SUSPENDED', self::EXPORTED => 'EXPORTED', @@ -87,6 +103,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Domains\V1alpha2\Registration_State::class); diff --git a/Domains/src/V1alpha2/RetrieveRegisterParametersResponse.php b/Domains/src/V1alpha2/RetrieveRegisterParametersResponse.php index b23b761610e6..2324c2b72328 100644 --- a/Domains/src/V1alpha2/RetrieveRegisterParametersResponse.php +++ b/Domains/src/V1alpha2/RetrieveRegisterParametersResponse.php @@ -45,7 +45,7 @@ public function __construct($data = NULL) { */ public function getRegisterParameters() { - return isset($this->register_parameters) ? $this->register_parameters : null; + return $this->register_parameters; } public function hasRegisterParameters() diff --git a/Domains/src/V1alpha2/RetrieveTransferParametersRequest.php b/Domains/src/V1alpha2/RetrieveTransferParametersRequest.php new file mode 100644 index 000000000000..7e2c363de921 --- /dev/null +++ b/Domains/src/V1alpha2/RetrieveTransferParametersRequest.php @@ -0,0 +1,101 @@ +google.cloud.domains.v1alpha2.RetrieveTransferParametersRequest + */ +class RetrieveTransferParametersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The domain name. Unicode domain names must be expressed in Punycode format. + * + * Generated from protobuf field string domain_name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $domain_name = ''; + /** + * Required. The location. Must be in the format `projects/*/locations/*`. + * + * Generated from protobuf field string location = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $location = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $domain_name + * Required. The domain name. Unicode domain names must be expressed in Punycode format. + * @type string $location + * Required. The location. Must be in the format `projects/*/locations/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Domains\V1Alpha2\Domains::initOnce(); + parent::__construct($data); + } + + /** + * Required. The domain name. Unicode domain names must be expressed in Punycode format. + * + * Generated from protobuf field string domain_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDomainName() + { + return $this->domain_name; + } + + /** + * Required. The domain name. Unicode domain names must be expressed in Punycode format. + * + * Generated from protobuf field string domain_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDomainName($var) + { + GPBUtil::checkString($var, True); + $this->domain_name = $var; + + return $this; + } + + /** + * Required. The location. Must be in the format `projects/*/locations/*`. + * + * Generated from protobuf field string location = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * Required. The location. Must be in the format `projects/*/locations/*`. + * + * Generated from protobuf field string location = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + +} + diff --git a/Domains/src/V1alpha2/RetrieveTransferParametersResponse.php b/Domains/src/V1alpha2/RetrieveTransferParametersResponse.php new file mode 100644 index 000000000000..4713757fa3e3 --- /dev/null +++ b/Domains/src/V1alpha2/RetrieveTransferParametersResponse.php @@ -0,0 +1,77 @@ +google.cloud.domains.v1alpha2.RetrieveTransferParametersResponse + */ +class RetrieveTransferParametersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Parameters to use when calling the `TransferDomain` method. + * + * Generated from protobuf field .google.cloud.domains.v1alpha2.TransferParameters transfer_parameters = 1; + */ + private $transfer_parameters = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Domains\V1alpha2\TransferParameters $transfer_parameters + * Parameters to use when calling the `TransferDomain` method. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Domains\V1Alpha2\Domains::initOnce(); + parent::__construct($data); + } + + /** + * Parameters to use when calling the `TransferDomain` method. + * + * Generated from protobuf field .google.cloud.domains.v1alpha2.TransferParameters transfer_parameters = 1; + * @return \Google\Cloud\Domains\V1alpha2\TransferParameters|null + */ + public function getTransferParameters() + { + return $this->transfer_parameters; + } + + public function hasTransferParameters() + { + return isset($this->transfer_parameters); + } + + public function clearTransferParameters() + { + unset($this->transfer_parameters); + } + + /** + * Parameters to use when calling the `TransferDomain` method. + * + * Generated from protobuf field .google.cloud.domains.v1alpha2.TransferParameters transfer_parameters = 1; + * @param \Google\Cloud\Domains\V1alpha2\TransferParameters $var + * @return $this + */ + public function setTransferParameters($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Domains\V1alpha2\TransferParameters::class); + $this->transfer_parameters = $var; + + return $this; + } + +} + diff --git a/Domains/src/V1alpha2/TransferDomainRequest.php b/Domains/src/V1alpha2/TransferDomainRequest.php new file mode 100644 index 000000000000..efbc29f32778 --- /dev/null +++ b/Domains/src/V1alpha2/TransferDomainRequest.php @@ -0,0 +1,311 @@ +google.cloud.domains.v1alpha2.TransferDomainRequest + */ +class TransferDomainRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource of the `Registration`. Must be in the + * format `projects/*/locations/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * Required. The complete `Registration` resource to be created. + * You can leave `registration.dns_settings` unset to import the + * domain's current DNS configuration from its current registrar. Use this + * option only if you are sure that the domain's current DNS service + * does not cease upon transfer, as is often the case for DNS services + * provided for free by the registrar. + * + * Generated from protobuf field .google.cloud.domains.v1alpha2.Registration registration = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $registration = null; + /** + * The list of contact notices that you acknowledge. The notices + * needed here depend on the values specified in + * `registration.contact_settings`. + * + * Generated from protobuf field repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 3; + */ + private $contact_notices; + /** + * Required. Acknowledgement of the price to transfer or renew the domain for one year. + * Call `RetrieveTransferParameters` to obtain the price, which you must + * acknowledge. + * + * Generated from protobuf field .google.type.Money yearly_price = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $yearly_price = null; + /** + * The domain's transfer authorization code. You can obtain this from the + * domain's current registrar. + * + * Generated from protobuf field .google.cloud.domains.v1alpha2.AuthorizationCode authorization_code = 5; + */ + private $authorization_code = null; + /** + * Validate the request without actually transferring the domain. + * + * Generated from protobuf field bool validate_only = 6; + */ + private $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource of the `Registration`. Must be in the + * format `projects/*/locations/*`. + * @type \Google\Cloud\Domains\V1alpha2\Registration $registration + * Required. The complete `Registration` resource to be created. + * You can leave `registration.dns_settings` unset to import the + * domain's current DNS configuration from its current registrar. Use this + * option only if you are sure that the domain's current DNS service + * does not cease upon transfer, as is often the case for DNS services + * provided for free by the registrar. + * @type int[]|\Google\Protobuf\Internal\RepeatedField $contact_notices + * The list of contact notices that you acknowledge. The notices + * needed here depend on the values specified in + * `registration.contact_settings`. + * @type \Google\Type\Money $yearly_price + * Required. Acknowledgement of the price to transfer or renew the domain for one year. + * Call `RetrieveTransferParameters` to obtain the price, which you must + * acknowledge. + * @type \Google\Cloud\Domains\V1alpha2\AuthorizationCode $authorization_code + * The domain's transfer authorization code. You can obtain this from the + * domain's current registrar. + * @type bool $validate_only + * Validate the request without actually transferring the domain. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Domains\V1Alpha2\Domains::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource of the `Registration`. Must be in the + * format `projects/*/locations/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource of the `Registration`. Must be in the + * format `projects/*/locations/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The complete `Registration` resource to be created. + * You can leave `registration.dns_settings` unset to import the + * domain's current DNS configuration from its current registrar. Use this + * option only if you are sure that the domain's current DNS service + * does not cease upon transfer, as is often the case for DNS services + * provided for free by the registrar. + * + * Generated from protobuf field .google.cloud.domains.v1alpha2.Registration registration = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Domains\V1alpha2\Registration|null + */ + public function getRegistration() + { + return $this->registration; + } + + public function hasRegistration() + { + return isset($this->registration); + } + + public function clearRegistration() + { + unset($this->registration); + } + + /** + * Required. The complete `Registration` resource to be created. + * You can leave `registration.dns_settings` unset to import the + * domain's current DNS configuration from its current registrar. Use this + * option only if you are sure that the domain's current DNS service + * does not cease upon transfer, as is often the case for DNS services + * provided for free by the registrar. + * + * Generated from protobuf field .google.cloud.domains.v1alpha2.Registration registration = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Domains\V1alpha2\Registration $var + * @return $this + */ + public function setRegistration($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Domains\V1alpha2\Registration::class); + $this->registration = $var; + + return $this; + } + + /** + * The list of contact notices that you acknowledge. The notices + * needed here depend on the values specified in + * `registration.contact_settings`. + * + * Generated from protobuf field repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getContactNotices() + { + return $this->contact_notices; + } + + /** + * The list of contact notices that you acknowledge. The notices + * needed here depend on the values specified in + * `registration.contact_settings`. + * + * Generated from protobuf field repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 3; + * @param int[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setContactNotices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Domains\V1alpha2\ContactNotice::class); + $this->contact_notices = $arr; + + return $this; + } + + /** + * Required. Acknowledgement of the price to transfer or renew the domain for one year. + * Call `RetrieveTransferParameters` to obtain the price, which you must + * acknowledge. + * + * Generated from protobuf field .google.type.Money yearly_price = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Type\Money|null + */ + public function getYearlyPrice() + { + return $this->yearly_price; + } + + public function hasYearlyPrice() + { + return isset($this->yearly_price); + } + + public function clearYearlyPrice() + { + unset($this->yearly_price); + } + + /** + * Required. Acknowledgement of the price to transfer or renew the domain for one year. + * Call `RetrieveTransferParameters` to obtain the price, which you must + * acknowledge. + * + * Generated from protobuf field .google.type.Money yearly_price = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Type\Money $var + * @return $this + */ + public function setYearlyPrice($var) + { + GPBUtil::checkMessage($var, \Google\Type\Money::class); + $this->yearly_price = $var; + + return $this; + } + + /** + * The domain's transfer authorization code. You can obtain this from the + * domain's current registrar. + * + * Generated from protobuf field .google.cloud.domains.v1alpha2.AuthorizationCode authorization_code = 5; + * @return \Google\Cloud\Domains\V1alpha2\AuthorizationCode|null + */ + public function getAuthorizationCode() + { + return $this->authorization_code; + } + + public function hasAuthorizationCode() + { + return isset($this->authorization_code); + } + + public function clearAuthorizationCode() + { + unset($this->authorization_code); + } + + /** + * The domain's transfer authorization code. You can obtain this from the + * domain's current registrar. + * + * Generated from protobuf field .google.cloud.domains.v1alpha2.AuthorizationCode authorization_code = 5; + * @param \Google\Cloud\Domains\V1alpha2\AuthorizationCode $var + * @return $this + */ + public function setAuthorizationCode($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Domains\V1alpha2\AuthorizationCode::class); + $this->authorization_code = $var; + + return $this; + } + + /** + * Validate the request without actually transferring the domain. + * + * Generated from protobuf field bool validate_only = 6; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Validate the request without actually transferring the domain. + * + * Generated from protobuf field bool validate_only = 6; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/Domains/src/V1alpha2/TransferParameters.php b/Domains/src/V1alpha2/TransferParameters.php new file mode 100644 index 000000000000..4408154edbed --- /dev/null +++ b/Domains/src/V1alpha2/TransferParameters.php @@ -0,0 +1,255 @@ +google.cloud.domains.v1alpha2.TransferParameters + */ +class TransferParameters extends \Google\Protobuf\Internal\Message +{ + /** + * The domain name. Unicode domain names are expressed in Punycode format. + * + * Generated from protobuf field string domain_name = 1; + */ + private $domain_name = ''; + /** + * The registrar that currently manages the domain. + * + * Generated from protobuf field string current_registrar = 2; + */ + private $current_registrar = ''; + /** + * The name servers that currently store the configuration of the domain. + * + * Generated from protobuf field repeated string name_servers = 3; + */ + private $name_servers; + /** + * Indicates whether the domain is protected by a transfer lock. For a + * transfer to succeed, this must show `UNLOCKED`. To unlock a domain, + * go to its current registrar. + * + * Generated from protobuf field .google.cloud.domains.v1alpha2.TransferLockState transfer_lock_state = 4; + */ + private $transfer_lock_state = 0; + /** + * Contact privacy options that the domain supports. + * + * Generated from protobuf field repeated .google.cloud.domains.v1alpha2.ContactPrivacy supported_privacy = 5; + */ + private $supported_privacy; + /** + * Price to transfer or renew the domain for one year. + * + * Generated from protobuf field .google.type.Money yearly_price = 6; + */ + private $yearly_price = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $domain_name + * The domain name. Unicode domain names are expressed in Punycode format. + * @type string $current_registrar + * The registrar that currently manages the domain. + * @type string[]|\Google\Protobuf\Internal\RepeatedField $name_servers + * The name servers that currently store the configuration of the domain. + * @type int $transfer_lock_state + * Indicates whether the domain is protected by a transfer lock. For a + * transfer to succeed, this must show `UNLOCKED`. To unlock a domain, + * go to its current registrar. + * @type int[]|\Google\Protobuf\Internal\RepeatedField $supported_privacy + * Contact privacy options that the domain supports. + * @type \Google\Type\Money $yearly_price + * Price to transfer or renew the domain for one year. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Domains\V1Alpha2\Domains::initOnce(); + parent::__construct($data); + } + + /** + * The domain name. Unicode domain names are expressed in Punycode format. + * + * Generated from protobuf field string domain_name = 1; + * @return string + */ + public function getDomainName() + { + return $this->domain_name; + } + + /** + * The domain name. Unicode domain names are expressed in Punycode format. + * + * Generated from protobuf field string domain_name = 1; + * @param string $var + * @return $this + */ + public function setDomainName($var) + { + GPBUtil::checkString($var, True); + $this->domain_name = $var; + + return $this; + } + + /** + * The registrar that currently manages the domain. + * + * Generated from protobuf field string current_registrar = 2; + * @return string + */ + public function getCurrentRegistrar() + { + return $this->current_registrar; + } + + /** + * The registrar that currently manages the domain. + * + * Generated from protobuf field string current_registrar = 2; + * @param string $var + * @return $this + */ + public function setCurrentRegistrar($var) + { + GPBUtil::checkString($var, True); + $this->current_registrar = $var; + + return $this; + } + + /** + * The name servers that currently store the configuration of the domain. + * + * Generated from protobuf field repeated string name_servers = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNameServers() + { + return $this->name_servers; + } + + /** + * The name servers that currently store the configuration of the domain. + * + * Generated from protobuf field repeated string name_servers = 3; + * @param string[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNameServers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->name_servers = $arr; + + return $this; + } + + /** + * Indicates whether the domain is protected by a transfer lock. For a + * transfer to succeed, this must show `UNLOCKED`. To unlock a domain, + * go to its current registrar. + * + * Generated from protobuf field .google.cloud.domains.v1alpha2.TransferLockState transfer_lock_state = 4; + * @return int + */ + public function getTransferLockState() + { + return $this->transfer_lock_state; + } + + /** + * Indicates whether the domain is protected by a transfer lock. For a + * transfer to succeed, this must show `UNLOCKED`. To unlock a domain, + * go to its current registrar. + * + * Generated from protobuf field .google.cloud.domains.v1alpha2.TransferLockState transfer_lock_state = 4; + * @param int $var + * @return $this + */ + public function setTransferLockState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Domains\V1alpha2\TransferLockState::class); + $this->transfer_lock_state = $var; + + return $this; + } + + /** + * Contact privacy options that the domain supports. + * + * Generated from protobuf field repeated .google.cloud.domains.v1alpha2.ContactPrivacy supported_privacy = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSupportedPrivacy() + { + return $this->supported_privacy; + } + + /** + * Contact privacy options that the domain supports. + * + * Generated from protobuf field repeated .google.cloud.domains.v1alpha2.ContactPrivacy supported_privacy = 5; + * @param int[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSupportedPrivacy($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Domains\V1alpha2\ContactPrivacy::class); + $this->supported_privacy = $arr; + + return $this; + } + + /** + * Price to transfer or renew the domain for one year. + * + * Generated from protobuf field .google.type.Money yearly_price = 6; + * @return \Google\Type\Money|null + */ + public function getYearlyPrice() + { + return $this->yearly_price; + } + + public function hasYearlyPrice() + { + return isset($this->yearly_price); + } + + public function clearYearlyPrice() + { + unset($this->yearly_price); + } + + /** + * Price to transfer or renew the domain for one year. + * + * Generated from protobuf field .google.type.Money yearly_price = 6; + * @param \Google\Type\Money $var + * @return $this + */ + public function setYearlyPrice($var) + { + GPBUtil::checkMessage($var, \Google\Type\Money::class); + $this->yearly_price = $var; + + return $this; + } + +} + diff --git a/Domains/src/V1alpha2/UpdateRegistrationRequest.php b/Domains/src/V1alpha2/UpdateRegistrationRequest.php index 81dfc39b5f13..cc1aa02016a3 100644 --- a/Domains/src/V1alpha2/UpdateRegistrationRequest.php +++ b/Domains/src/V1alpha2/UpdateRegistrationRequest.php @@ -23,8 +23,8 @@ class UpdateRegistrationRequest extends \Google\Protobuf\Internal\Message private $registration = null; /** * Required. The field mask describing which fields to update as a comma-separated list. - * For example, if only the labels are being updated, the `update_mask` would - * be `"labels"`. + * For example, if only the labels are being updated, the `update_mask` is + * `"labels"`. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; */ @@ -40,8 +40,8 @@ class UpdateRegistrationRequest extends \Google\Protobuf\Internal\Message * Fields of the `Registration` to update. * @type \Google\Protobuf\FieldMask $update_mask * Required. The field mask describing which fields to update as a comma-separated list. - * For example, if only the labels are being updated, the `update_mask` would - * be `"labels"`. + * For example, if only the labels are being updated, the `update_mask` is + * `"labels"`. * } */ public function __construct($data = NULL) { @@ -57,7 +57,7 @@ public function __construct($data = NULL) { */ public function getRegistration() { - return isset($this->registration) ? $this->registration : null; + return $this->registration; } public function hasRegistration() @@ -87,15 +87,15 @@ public function setRegistration($var) /** * Required. The field mask describing which fields to update as a comma-separated list. - * For example, if only the labels are being updated, the `update_mask` would - * be `"labels"`. + * For example, if only the labels are being updated, the `update_mask` is + * `"labels"`. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; * @return \Google\Protobuf\FieldMask|null */ public function getUpdateMask() { - return isset($this->update_mask) ? $this->update_mask : null; + return $this->update_mask; } public function hasUpdateMask() @@ -110,8 +110,8 @@ public function clearUpdateMask() /** * Required. The field mask describing which fields to update as a comma-separated list. - * For example, if only the labels are being updated, the `update_mask` would - * be `"labels"`. + * For example, if only the labels are being updated, the `update_mask` is + * `"labels"`. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; * @param \Google\Protobuf\FieldMask $var diff --git a/Domains/src/V1alpha2/gapic_metadata.json b/Domains/src/V1alpha2/gapic_metadata.json index c3584608e180..63eb4208305c 100644 --- a/Domains/src/V1alpha2/gapic_metadata.json +++ b/Domains/src/V1alpha2/gapic_metadata.json @@ -65,11 +65,21 @@ "retrieveRegisterParameters" ] }, + "RetrieveTransferParameters": { + "methods": [ + "retrieveTransferParameters" + ] + }, "SearchDomains": { "methods": [ "searchDomains" ] }, + "TransferDomain": { + "methods": [ + "transferDomain" + ] + }, "UpdateRegistration": { "methods": [ "updateRegistration" diff --git a/Domains/src/V1alpha2/resources/domains_client_config.json b/Domains/src/V1alpha2/resources/domains_client_config.json index 2ff4dc2494c3..6bfd4a2253d4 100644 --- a/Domains/src/V1alpha2/resources/domains_client_config.json +++ b/Domains/src/V1alpha2/resources/domains_client_config.json @@ -93,11 +93,21 @@ "retry_codes_name": "no_retry_codes", "retry_params_name": "no_retry_params" }, + "RetrieveTransferParameters": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "SearchDomains": { "timeout_millis": 60000, "retry_codes_name": "no_retry_codes", "retry_params_name": "no_retry_params" }, + "TransferDomain": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "UpdateRegistration": { "timeout_millis": 60000, "retry_codes_name": "no_retry_codes", diff --git a/Domains/src/V1alpha2/resources/domains_descriptor_config.php b/Domains/src/V1alpha2/resources/domains_descriptor_config.php index 7f2110c0c423..2adf181e173d 100644 --- a/Domains/src/V1alpha2/resources/domains_descriptor_config.php +++ b/Domains/src/V1alpha2/resources/domains_descriptor_config.php @@ -63,6 +63,16 @@ 'totalPollTimeoutMillis' => '300000', ], ], + 'TransferDomain' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Domains\V1alpha2\Registration', + 'metadataReturnType' => '\Google\Cloud\Domains\V1alpha2\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], 'UpdateRegistration' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\Domains\V1alpha2\Registration', diff --git a/Domains/src/V1alpha2/resources/domains_rest_client_config.php b/Domains/src/V1alpha2/resources/domains_rest_client_config.php index f8843442d3ce..3e6115ca7525 100644 --- a/Domains/src/V1alpha2/resources/domains_rest_client_config.php +++ b/Domains/src/V1alpha2/resources/domains_rest_client_config.php @@ -130,6 +130,17 @@ ], ], ], + 'RetrieveTransferParameters' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha2/{location=projects/*/locations/*}/registrations:retrieveTransferParameters', + 'placeholders' => [ + 'location' => [ + 'getters' => [ + 'getLocation', + ], + ], + ], + ], 'SearchDomains' => [ 'method' => 'get', 'uriTemplate' => '/v1alpha2/{location=projects/*/locations/*}/registrations:searchDomains', @@ -141,6 +152,18 @@ ], ], ], + 'TransferDomain' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha2/{parent=projects/*/locations/*}/registrations:transfer', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'UpdateRegistration' => [ 'method' => 'patch', 'uriTemplate' => '/v1alpha2/{registration.name=projects/*/locations/*/registrations/*}', @@ -153,12 +176,15 @@ ], ], ], + 'queryParams' => [ + 'update_mask', + ], ], ], - 'google.longrunning.Operations' => [ - 'ListOperations' => [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ 'method' => 'get', - 'uriTemplate' => '/v1alpha2/{name=projects/*/locations/*}/operations', + 'uriTemplate' => '/v1alpha2/{name=projects/*/locations/*}', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -167,9 +193,9 @@ ], ], ], - 'GetOperation' => [ + 'ListLocations' => [ 'method' => 'get', - 'uriTemplate' => '/v1alpha2/{name=projects/*/locations/*/operations/*}', + 'uriTemplate' => '/v1alpha2/{name=projects/*}/locations', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -178,8 +204,47 @@ ], ], ], - 'DeleteOperation' => [ - 'method' => 'delete', + ], + 'google.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha2/{resource=projects/*/locations/*/registrations/*}:getIamPolicy', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha2/{resource=projects/*/locations/*/registrations/*}:setIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha2/{resource=projects/*/locations/*/registrations/*}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', 'uriTemplate' => '/v1alpha2/{name=projects/*/locations/*/operations/*}', 'placeholders' => [ 'name' => [ @@ -189,9 +254,9 @@ ], ], ], - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha2/{name=projects/*/locations/*/operations/*}:cancel', + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha2/{name=projects/*/locations/*}/operations', 'placeholders' => [ 'name' => [ 'getters' => [ diff --git a/Domains/src/V1beta1/ConfigureContactSettingsRequest.php b/Domains/src/V1beta1/ConfigureContactSettingsRequest.php index 9bbd425bcfca..b8081a8518d1 100644 --- a/Domains/src/V1beta1/ConfigureContactSettingsRequest.php +++ b/Domains/src/V1beta1/ConfigureContactSettingsRequest.php @@ -31,14 +31,14 @@ class ConfigureContactSettingsRequest extends \Google\Protobuf\Internal\Message /** * Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the registrant contact is being updated, the - * `update_mask` would be `"registrant_contact"`. + * `update_mask` is `"registrant_contact"`. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; */ private $update_mask = null; /** * The list of contact notices that the caller acknowledges. The notices - * required here depend on the values specified in `contact_settings`. + * needed here depend on the values specified in `contact_settings`. * * Generated from protobuf field repeated .google.cloud.domains.v1beta1.ContactNotice contact_notices = 4; */ @@ -64,10 +64,10 @@ class ConfigureContactSettingsRequest extends \Google\Protobuf\Internal\Message * @type \Google\Protobuf\FieldMask $update_mask * Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the registrant contact is being updated, the - * `update_mask` would be `"registrant_contact"`. + * `update_mask` is `"registrant_contact"`. * @type int[]|\Google\Protobuf\Internal\RepeatedField $contact_notices * The list of contact notices that the caller acknowledges. The notices - * required here depend on the values specified in `contact_settings`. + * needed here depend on the values specified in `contact_settings`. * @type bool $validate_only * Validate the request without actually updating the contact settings. * } @@ -113,7 +113,7 @@ public function setRegistration($var) */ public function getContactSettings() { - return isset($this->contact_settings) ? $this->contact_settings : null; + return $this->contact_settings; } public function hasContactSettings() @@ -144,14 +144,14 @@ public function setContactSettings($var) /** * Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the registrant contact is being updated, the - * `update_mask` would be `"registrant_contact"`. + * `update_mask` is `"registrant_contact"`. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; * @return \Google\Protobuf\FieldMask|null */ public function getUpdateMask() { - return isset($this->update_mask) ? $this->update_mask : null; + return $this->update_mask; } public function hasUpdateMask() @@ -167,7 +167,7 @@ public function clearUpdateMask() /** * Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the registrant contact is being updated, the - * `update_mask` would be `"registrant_contact"`. + * `update_mask` is `"registrant_contact"`. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; * @param \Google\Protobuf\FieldMask $var @@ -183,7 +183,7 @@ public function setUpdateMask($var) /** * The list of contact notices that the caller acknowledges. The notices - * required here depend on the values specified in `contact_settings`. + * needed here depend on the values specified in `contact_settings`. * * Generated from protobuf field repeated .google.cloud.domains.v1beta1.ContactNotice contact_notices = 4; * @return \Google\Protobuf\Internal\RepeatedField @@ -195,7 +195,7 @@ public function getContactNotices() /** * The list of contact notices that the caller acknowledges. The notices - * required here depend on the values specified in `contact_settings`. + * needed here depend on the values specified in `contact_settings`. * * Generated from protobuf field repeated .google.cloud.domains.v1beta1.ContactNotice contact_notices = 4; * @param int[]|\Google\Protobuf\Internal\RepeatedField $var diff --git a/Domains/src/V1beta1/ConfigureDnsSettingsRequest.php b/Domains/src/V1beta1/ConfigureDnsSettingsRequest.php index b375c632b457..cd2bb3065601 100644 --- a/Domains/src/V1beta1/ConfigureDnsSettingsRequest.php +++ b/Domains/src/V1beta1/ConfigureDnsSettingsRequest.php @@ -31,12 +31,12 @@ class ConfigureDnsSettingsRequest extends \Google\Protobuf\Internal\Message /** * Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the name servers are being updated for an existing - * Custom DNS configuration, the `update_mask` would be + * Custom DNS configuration, the `update_mask` is * `"custom_dns.name_servers"`. * When changing the DNS provider from one type to another, pass the new * provider's field name as part of the field mask. For example, when changing * from a Google Domains DNS configuration to a Custom DNS configuration, the - * `update_mask` would be `"custom_dns"`. // + * `update_mask` is `"custom_dns"`. // * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; */ @@ -62,12 +62,12 @@ class ConfigureDnsSettingsRequest extends \Google\Protobuf\Internal\Message * @type \Google\Protobuf\FieldMask $update_mask * Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the name servers are being updated for an existing - * Custom DNS configuration, the `update_mask` would be + * Custom DNS configuration, the `update_mask` is * `"custom_dns.name_servers"`. * When changing the DNS provider from one type to another, pass the new * provider's field name as part of the field mask. For example, when changing * from a Google Domains DNS configuration to a Custom DNS configuration, the - * `update_mask` would be `"custom_dns"`. // + * `update_mask` is `"custom_dns"`. // * @type bool $validate_only * Validate the request without actually updating the DNS settings. * } @@ -113,7 +113,7 @@ public function setRegistration($var) */ public function getDnsSettings() { - return isset($this->dns_settings) ? $this->dns_settings : null; + return $this->dns_settings; } public function hasDnsSettings() @@ -144,19 +144,19 @@ public function setDnsSettings($var) /** * Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the name servers are being updated for an existing - * Custom DNS configuration, the `update_mask` would be + * Custom DNS configuration, the `update_mask` is * `"custom_dns.name_servers"`. * When changing the DNS provider from one type to another, pass the new * provider's field name as part of the field mask. For example, when changing * from a Google Domains DNS configuration to a Custom DNS configuration, the - * `update_mask` would be `"custom_dns"`. // + * `update_mask` is `"custom_dns"`. // * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; * @return \Google\Protobuf\FieldMask|null */ public function getUpdateMask() { - return isset($this->update_mask) ? $this->update_mask : null; + return $this->update_mask; } public function hasUpdateMask() @@ -172,12 +172,12 @@ public function clearUpdateMask() /** * Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the name servers are being updated for an existing - * Custom DNS configuration, the `update_mask` would be + * Custom DNS configuration, the `update_mask` is * `"custom_dns.name_servers"`. * When changing the DNS provider from one type to another, pass the new * provider's field name as part of the field mask. For example, when changing * from a Google Domains DNS configuration to a Custom DNS configuration, the - * `update_mask` would be `"custom_dns"`. // + * `update_mask` is `"custom_dns"`. // * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; * @param \Google\Protobuf\FieldMask $var diff --git a/Domains/src/V1beta1/ConfigureManagementSettingsRequest.php b/Domains/src/V1beta1/ConfigureManagementSettingsRequest.php index 0ef652eb92e1..ecb9bb17b59b 100644 --- a/Domains/src/V1beta1/ConfigureManagementSettingsRequest.php +++ b/Domains/src/V1beta1/ConfigureManagementSettingsRequest.php @@ -31,7 +31,7 @@ class ConfigureManagementSettingsRequest extends \Google\Protobuf\Internal\Messa /** * Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the transfer lock is being updated, the `update_mask` - * would be `"transfer_lock_state"`. + * is `"transfer_lock_state"`. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; */ @@ -51,7 +51,7 @@ class ConfigureManagementSettingsRequest extends \Google\Protobuf\Internal\Messa * @type \Google\Protobuf\FieldMask $update_mask * Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the transfer lock is being updated, the `update_mask` - * would be `"transfer_lock_state"`. + * is `"transfer_lock_state"`. * } */ public function __construct($data = NULL) { @@ -95,7 +95,7 @@ public function setRegistration($var) */ public function getManagementSettings() { - return isset($this->management_settings) ? $this->management_settings : null; + return $this->management_settings; } public function hasManagementSettings() @@ -126,14 +126,14 @@ public function setManagementSettings($var) /** * Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the transfer lock is being updated, the `update_mask` - * would be `"transfer_lock_state"`. + * is `"transfer_lock_state"`. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; * @return \Google\Protobuf\FieldMask|null */ public function getUpdateMask() { - return isset($this->update_mask) ? $this->update_mask : null; + return $this->update_mask; } public function hasUpdateMask() @@ -149,7 +149,7 @@ public function clearUpdateMask() /** * Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the transfer lock is being updated, the `update_mask` - * would be `"transfer_lock_state"`. + * is `"transfer_lock_state"`. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; * @param \Google\Protobuf\FieldMask $var diff --git a/Domains/src/V1beta1/ContactSettings.php b/Domains/src/V1beta1/ContactSettings.php index 7f13f5501deb..0f112056036d 100644 --- a/Domains/src/V1beta1/ContactSettings.php +++ b/Domains/src/V1beta1/ContactSettings.php @@ -28,8 +28,8 @@ class ContactSettings extends \Google\Protobuf\Internal\Message * Required. The registrant contact for the `Registration`. * *Caution: Anyone with access to this email address, phone number, * and/or postal address can take control of the domain.* - * *Warning: For new `Registration`s, the registrant will receive an email - * confirmation that they must complete within 14 days to avoid domain + * *Warning: For new `Registration`s, the registrant receives an email + * confirmation that they must complete within 15 days to avoid domain * suspension.* * * Generated from protobuf field .google.cloud.domains.v1beta1.ContactSettings.Contact registrant_contact = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -60,8 +60,8 @@ class ContactSettings extends \Google\Protobuf\Internal\Message * Required. The registrant contact for the `Registration`. * *Caution: Anyone with access to this email address, phone number, * and/or postal address can take control of the domain.* - * *Warning: For new `Registration`s, the registrant will receive an email - * confirmation that they must complete within 14 days to avoid domain + * *Warning: For new `Registration`s, the registrant receives an email + * confirmation that they must complete within 15 days to avoid domain * suspension.* * @type \Google\Cloud\Domains\V1beta1\ContactSettings\Contact $admin_contact * Required. The administrative contact for the `Registration`. @@ -104,8 +104,8 @@ public function setPrivacy($var) * Required. The registrant contact for the `Registration`. * *Caution: Anyone with access to this email address, phone number, * and/or postal address can take control of the domain.* - * *Warning: For new `Registration`s, the registrant will receive an email - * confirmation that they must complete within 14 days to avoid domain + * *Warning: For new `Registration`s, the registrant receives an email + * confirmation that they must complete within 15 days to avoid domain * suspension.* * * Generated from protobuf field .google.cloud.domains.v1beta1.ContactSettings.Contact registrant_contact = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -113,7 +113,7 @@ public function setPrivacy($var) */ public function getRegistrantContact() { - return isset($this->registrant_contact) ? $this->registrant_contact : null; + return $this->registrant_contact; } public function hasRegistrantContact() @@ -130,8 +130,8 @@ public function clearRegistrantContact() * Required. The registrant contact for the `Registration`. * *Caution: Anyone with access to this email address, phone number, * and/or postal address can take control of the domain.* - * *Warning: For new `Registration`s, the registrant will receive an email - * confirmation that they must complete within 14 days to avoid domain + * *Warning: For new `Registration`s, the registrant receives an email + * confirmation that they must complete within 15 days to avoid domain * suspension.* * * Generated from protobuf field .google.cloud.domains.v1beta1.ContactSettings.Contact registrant_contact = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -154,7 +154,7 @@ public function setRegistrantContact($var) */ public function getAdminContact() { - return isset($this->admin_contact) ? $this->admin_contact : null; + return $this->admin_contact; } public function hasAdminContact() @@ -190,7 +190,7 @@ public function setAdminContact($var) */ public function getTechnicalContact() { - return isset($this->technical_contact) ? $this->technical_contact : null; + return $this->technical_contact; } public function hasTechnicalContact() diff --git a/Domains/src/V1beta1/ContactSettings/Contact.php b/Domains/src/V1beta1/ContactSettings/Contact.php index 7ee8db5eba9c..2c9411e078d0 100644 --- a/Domains/src/V1beta1/ContactSettings/Contact.php +++ b/Domains/src/V1beta1/ContactSettings/Contact.php @@ -73,7 +73,7 @@ public function __construct($data = NULL) { */ public function getPostalAddress() { - return isset($this->postal_address) ? $this->postal_address : null; + return $this->postal_address; } public function hasPostalAddress() @@ -185,6 +185,4 @@ public function setFaxNumber($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Contact::class, \Google\Cloud\Domains\V1beta1\ContactSettings_Contact::class); diff --git a/Domains/src/V1beta1/DnsSettings/CustomDns.php b/Domains/src/V1beta1/DnsSettings/CustomDns.php index b574640d33e5..6fe2f933230b 100644 --- a/Domains/src/V1beta1/DnsSettings/CustomDns.php +++ b/Domains/src/V1beta1/DnsSettings/CustomDns.php @@ -115,6 +115,4 @@ public function setDsRecords($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CustomDns::class, \Google\Cloud\Domains\V1beta1\DnsSettings_CustomDns::class); diff --git a/Domains/src/V1beta1/DnsSettings/DsRecord.php b/Domains/src/V1beta1/DnsSettings/DsRecord.php index a934155c2878..56d824b604f0 100644 --- a/Domains/src/V1beta1/DnsSettings/DsRecord.php +++ b/Domains/src/V1beta1/DnsSettings/DsRecord.php @@ -169,6 +169,4 @@ public function setDigest($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DsRecord::class, \Google\Cloud\Domains\V1beta1\DnsSettings_DsRecord::class); diff --git a/Domains/src/V1beta1/DnsSettings/DsRecord/Algorithm.php b/Domains/src/V1beta1/DnsSettings/DsRecord/Algorithm.php index 6629452c4963..c3ddedf64aea 100644 --- a/Domains/src/V1beta1/DnsSettings/DsRecord/Algorithm.php +++ b/Domains/src/V1beta1/DnsSettings/DsRecord/Algorithm.php @@ -20,6 +20,18 @@ class Algorithm * Generated from protobuf enum ALGORITHM_UNSPECIFIED = 0; */ const ALGORITHM_UNSPECIFIED = 0; + /** + * RSA/MD5. Cannot be used for new deployments. + * + * Generated from protobuf enum RSAMD5 = 1; + */ + const RSAMD5 = 1; + /** + * Diffie-Hellman. Cannot be used for new deployments. + * + * Generated from protobuf enum DH = 2; + */ + const DH = 2; /** * DSA/SHA1. Not recommended for new deployments. * @@ -92,9 +104,29 @@ class Algorithm * Generated from protobuf enum ED448 = 16; */ const ED448 = 16; + /** + * Reserved for Indirect Keys. Cannot be used for new deployments. + * + * Generated from protobuf enum INDIRECT = 252; + */ + const INDIRECT = 252; + /** + * Private algorithm. Cannot be used for new deployments. + * + * Generated from protobuf enum PRIVATEDNS = 253; + */ + const PRIVATEDNS = 253; + /** + * Private algorithm OID. Cannot be used for new deployments. + * + * Generated from protobuf enum PRIVATEOID = 254; + */ + const PRIVATEOID = 254; private static $valueToName = [ self::ALGORITHM_UNSPECIFIED => 'ALGORITHM_UNSPECIFIED', + self::RSAMD5 => 'RSAMD5', + self::DH => 'DH', self::DSA => 'DSA', self::ECC => 'ECC', self::RSASHA1 => 'RSASHA1', @@ -107,6 +139,9 @@ class Algorithm self::ECDSAP384SHA384 => 'ECDSAP384SHA384', self::ED25519 => 'ED25519', self::ED448 => 'ED448', + self::INDIRECT => 'INDIRECT', + self::PRIVATEDNS => 'PRIVATEDNS', + self::PRIVATEOID => 'PRIVATEOID', ]; public static function name($value) @@ -130,6 +165,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Algorithm::class, \Google\Cloud\Domains\V1beta1\DnsSettings_DsRecord_Algorithm::class); diff --git a/Domains/src/V1beta1/DnsSettings/DsRecord/DigestType.php b/Domains/src/V1beta1/DnsSettings/DsRecord/DigestType.php index cdc987629ae4..1de0cdc2ce37 100644 --- a/Domains/src/V1beta1/DnsSettings/DsRecord/DigestType.php +++ b/Domains/src/V1beta1/DnsSettings/DsRecord/DigestType.php @@ -74,6 +74,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DigestType::class, \Google\Cloud\Domains\V1beta1\DnsSettings_DsRecord_DigestType::class); diff --git a/Domains/src/V1beta1/DnsSettings/DsState.php b/Domains/src/V1beta1/DnsSettings/DsState.php index c201dec2b64e..ced9e8724c78 100644 --- a/Domains/src/V1beta1/DnsSettings/DsState.php +++ b/Domains/src/V1beta1/DnsSettings/DsState.php @@ -63,6 +63,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DsState::class, \Google\Cloud\Domains\V1beta1\DnsSettings_DsState::class); diff --git a/Domains/src/V1beta1/DnsSettings/GlueRecord.php b/Domains/src/V1beta1/DnsSettings/GlueRecord.php index c53ff1317275..75524ab33ffa 100644 --- a/Domains/src/V1beta1/DnsSettings/GlueRecord.php +++ b/Domains/src/V1beta1/DnsSettings/GlueRecord.php @@ -154,6 +154,4 @@ public function setIpv6Addresses($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(GlueRecord::class, \Google\Cloud\Domains\V1beta1\DnsSettings_GlueRecord::class); diff --git a/Domains/src/V1beta1/DnsSettings/GoogleDomainsDns.php b/Domains/src/V1beta1/DnsSettings/GoogleDomainsDns.php index 46e05f406e9c..f61159d475e2 100644 --- a/Domains/src/V1beta1/DnsSettings/GoogleDomainsDns.php +++ b/Domains/src/V1beta1/DnsSettings/GoogleDomainsDns.php @@ -160,6 +160,4 @@ public function setDsRecords($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(GoogleDomainsDns::class, \Google\Cloud\Domains\V1beta1\DnsSettings_GoogleDomainsDns::class); diff --git a/Domains/src/V1beta1/DomainsClient.php b/Domains/src/V1beta1/DomainsClient.php index 86a60a838182..4addf2534743 100644 --- a/Domains/src/V1beta1/DomainsClient.php +++ b/Domains/src/V1beta1/DomainsClient.php @@ -18,7 +18,7 @@ /* * GENERATED CODE WARNING * Generated by gapic-generator-php from the file - * https://github.com/google/googleapis/blob/master/google/cloud/domains/v1beta1/domains.proto + * https://github.com/googleapis/googleapis/blob/master/google/cloud/domains/v1beta1/domains.proto * Updates to the above are reflected here through a refresh process. * * @experimental diff --git a/Domains/src/V1beta1/DomainsGrpcClient.php b/Domains/src/V1beta1/DomainsGrpcClient.php index 5c82bc501c39..4509ae95dec3 100644 --- a/Domains/src/V1beta1/DomainsGrpcClient.php +++ b/Domains/src/V1beta1/DomainsGrpcClient.php @@ -94,6 +94,61 @@ public function RegisterDomain(\Google\Cloud\Domains\V1beta1\RegisterDomainReque $metadata, $options); } + /** + * Gets parameters needed to transfer a domain name from another registrar to + * Cloud Domains. For domains managed by Google Domains, transferring to Cloud + * Domains is not supported. + * + * + * Use the returned values to call `TransferDomain`. + * @param \Google\Cloud\Domains\V1beta1\RetrieveTransferParametersRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function RetrieveTransferParameters(\Google\Cloud\Domains\V1beta1\RetrieveTransferParametersRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.domains.v1beta1.Domains/RetrieveTransferParameters', + $argument, + ['\Google\Cloud\Domains\V1beta1\RetrieveTransferParametersResponse', 'decode'], + $metadata, $options); + } + + /** + * Transfers a domain name from another registrar to Cloud Domains. For + * domains managed by Google Domains, transferring to Cloud Domains is not + * supported. + * + * + * Before calling this method, go to the domain's current registrar to unlock + * the domain for transfer and retrieve the domain's transfer authorization + * code. Then call `RetrieveTransferParameters` to confirm that the domain is + * unlocked and to get values needed to build a call to this method. + * + * A successful call creates a `Registration` resource in state + * `TRANSFER_PENDING`. It can take several days to complete the transfer + * process. The registrant can often speed up this process by approving the + * transfer through the current registrar, either by clicking a link in an + * email from the registrar or by visiting the registrar's website. + * + * A few minutes after transfer approval, the resource transitions to state + * `ACTIVE`, indicating that the transfer was successful. If the transfer is + * rejected or the request expires without being approved, the resource can + * end up in state `TRANSFER_FAILED`. If transfer fails, you can safely delete + * the resource and retry the transfer. + * @param \Google\Cloud\Domains\V1beta1\TransferDomainRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function TransferDomain(\Google\Cloud\Domains\V1beta1\TransferDomainRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.domains.v1beta1.Domains/TransferDomain', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + /** * Lists the `Registration` resources in a project. * @param \Google\Cloud\Domains\V1beta1\ListRegistrationsRequest $argument input argument @@ -191,20 +246,15 @@ public function ConfigureContactSettings(\Google\Cloud\Domains\V1beta1\Configure } /** - * Exports a `Registration` that you no longer want to use with - * Cloud Domains. You can continue to use the domain in - * [Google Domains](https://domains.google/) until it expires. + * Exports a `Registration` resource, such that it is no longer managed by + * Cloud Domains. * - * If the export is successful: - * - * * The resource's `state` becomes `EXPORTED`, meaning that it is no longer - * managed by Cloud Domains - * * Because individual users can own domains in Google Domains, the calling - * user becomes the domain's sole owner. Permissions for the domain are - * subsequently managed in Google Domains. - * * Without further action, the domain does not renew automatically. - * The new owner can set up billing in Google Domains to renew the domain - * if needed. + * When an active domain is successfully exported, you can continue to use the + * domain in [Google Domains](https://domains.google/) until it expires. The + * calling user becomes the domain's sole owner in Google Domains, and + * permissions for the domain are subsequently managed there. The domain does + * not renew automatically unless the new owner sets up billing in Google + * Domains. * @param \Google\Cloud\Domains\V1beta1\ExportRegistrationRequest $argument input argument * @param array $metadata metadata * @param array $options call options @@ -221,10 +271,23 @@ public function ExportRegistration(\Google\Cloud\Domains\V1beta1\ExportRegistrat /** * Deletes a `Registration` resource. * - * This method only works on resources in one of the following states: + * This method works on any `Registration` resource using [Subscription or + * Commitment billing](https://cloud.google.com/domains/pricing#billing-models), provided that the + * resource was created at least 1 day in the past. + * + * For `Registration` resources using + * [Monthly billing](https://cloud.google.com/domains/pricing#billing-models), this method works if: * * * `state` is `EXPORTED` with `expire_time` in the past * * `state` is `REGISTRATION_FAILED` + * * `state` is `TRANSFER_FAILED` + * + * When an active registration is successfully deleted, you can continue to + * use the domain in [Google Domains](https://domains.google/) until it + * expires. The calling user becomes the domain's sole owner in Google + * Domains, and permissions for the domain are subsequently managed there. The + * domain does not renew automatically unless the new owner sets up billing in + * Google Domains. * @param \Google\Cloud\Domains\V1beta1\DeleteRegistrationRequest $argument input argument * @param array $metadata metadata * @param array $options call options diff --git a/Domains/src/V1beta1/Gapic/DomainsGapicClient.php b/Domains/src/V1beta1/Gapic/DomainsGapicClient.php index f4b5f4c28474..f4255f19ef6e 100644 --- a/Domains/src/V1beta1/Gapic/DomainsGapicClient.php +++ b/Domains/src/V1beta1/Gapic/DomainsGapicClient.php @@ -18,7 +18,7 @@ /* * GENERATED CODE WARNING * Generated by gapic-generator-php from the file - * https://github.com/google/googleapis/blob/master/google/cloud/domains/v1beta1/domains.proto + * https://github.com/googleapis/googleapis/blob/master/google/cloud/domains/v1beta1/domains.proto * Updates to the above are reflected here through a refresh process. * * @experimental @@ -59,8 +59,11 @@ use Google\Cloud\Domains\V1beta1\RetrieveAuthorizationCodeRequest; use Google\Cloud\Domains\V1beta1\RetrieveRegisterParametersRequest; use Google\Cloud\Domains\V1beta1\RetrieveRegisterParametersResponse; +use Google\Cloud\Domains\V1beta1\RetrieveTransferParametersRequest; +use Google\Cloud\Domains\V1beta1\RetrieveTransferParametersResponse; use Google\Cloud\Domains\V1beta1\SearchDomainsRequest; use Google\Cloud\Domains\V1beta1\SearchDomainsResponse; +use Google\Cloud\Domains\V1beta1\TransferDomainRequest; use Google\Cloud\Domains\V1beta1\UpdateRegistrationRequest; use Google\LongRunning\Operation; use Google\Protobuf\FieldMask; @@ -109,9 +112,9 @@ * ``` * * Many parameters require resource names to be formatted in a particular way. To - * assistwith these names, this class includes a format method for each type of - * name, and additionallya parseName method to extract the individual identifiers - * contained within formatted namesthat are returned by the API. + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. * * @experimental */ @@ -370,6 +373,9 @@ public function resumeOperation($operationName, $methodName = null) * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. * } * * @throws ValidationException @@ -428,7 +434,7 @@ public function __construct(array $options = []) * in the format `projects/*/locations/*/registrations/*`. * @param FieldMask $updateMask Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the registrant contact is being updated, the - * `update_mask` would be `"registrant_contact"`. + * `update_mask` is `"registrant_contact"`. * @param array $optionalArgs { * Optional. * @@ -436,7 +442,7 @@ public function __construct(array $options = []) * Fields of the `ContactSettings` to update. * @type int[] $contactNotices * The list of contact notices that the caller acknowledges. The notices - * required here depend on the values specified in `contact_settings`. + * needed here depend on the values specified in `contact_settings`. * For allowed values, use constants defined on {@see \Google\Cloud\Domains\V1beta1\ContactNotice} * @type bool $validateOnly * Validate the request without actually updating the contact settings. @@ -521,13 +527,13 @@ public function configureContactSettings($registration, $updateMask, array $opti * in the format `projects/*/locations/*/registrations/*`. * @param FieldMask $updateMask Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the name servers are being updated for an existing - * Custom DNS configuration, the `update_mask` would be + * Custom DNS configuration, the `update_mask` is * `"custom_dns.name_servers"`. * * When changing the DNS provider from one type to another, pass the new * provider's field name as part of the field mask. For example, when changing * from a Google Domains DNS configuration to a Custom DNS configuration, the - * `update_mask` would be `"custom_dns"`. // + * `update_mask` is `"custom_dns"`. // * @param array $optionalArgs { * Optional. * @@ -612,7 +618,7 @@ public function configureDnsSettings($registration, $updateMask, array $optional * in the format `projects/*/locations/*/registrations/*`. * @param FieldMask $updateMask Required. The field mask describing which fields to update as a comma-separated list. * For example, if only the transfer lock is being updated, the `update_mask` - * would be `"transfer_lock_state"`. + * is `"transfer_lock_state"`. * @param array $optionalArgs { * Optional. * @@ -650,10 +656,23 @@ public function configureManagementSettings($registration, $updateMask, array $o /** * Deletes a `Registration` resource. * - * This method only works on resources in one of the following states: + * This method works on any `Registration` resource using [Subscription or + * Commitment billing](https://cloud.google.com/domains/pricing#billing-models), provided that the + * resource was created at least 1 day in the past. + * + * For `Registration` resources using + * [Monthly billing](https://cloud.google.com/domains/pricing#billing-models), this method works if: * * * `state` is `EXPORTED` with `expire_time` in the past * * `state` is `REGISTRATION_FAILED` + * * `state` is `TRANSFER_FAILED` + * + * When an active registration is successfully deleted, you can continue to + * use the domain in [Google Domains](https://domains.google/) until it + * expires. The calling user becomes the domain's sole owner in Google + * Domains, and permissions for the domain are subsequently managed there. The + * domain does not renew automatically unless the new owner sets up billing in + * Google Domains. * * Sample code: * ``` @@ -719,20 +738,15 @@ public function deleteRegistration($name, array $optionalArgs = []) } /** - * Exports a `Registration` that you no longer want to use with - * Cloud Domains. You can continue to use the domain in - * [Google Domains](https://domains.google/) until it expires. - * - * If the export is successful: + * Exports a `Registration` resource, such that it is no longer managed by + * Cloud Domains. * - * * The resource's `state` becomes `EXPORTED`, meaning that it is no longer - * managed by Cloud Domains - * * Because individual users can own domains in Google Domains, the calling - * user becomes the domain's sole owner. Permissions for the domain are - * subsequently managed in Google Domains. - * * Without further action, the domain does not renew automatically. - * The new owner can set up billing in Google Domains to renew the domain - * if needed. + * When an active domain is successfully exported, you can continue to use the + * domain in [Google Domains](https://domains.google/) until it expires. The + * calling user becomes the domain's sole owner in Google Domains, and + * permissions for the domain are subsequently managed there. The domain does + * not renew automatically unless the new owner sets up billing in Google + * Domains. * * Sample code: * ``` @@ -1003,11 +1017,11 @@ public function listRegistrations($parent, array $optionalArgs = []) * For allowed values, use constants defined on {@see \Google\Cloud\Domains\V1beta1\DomainNotice} * @type int[] $contactNotices * The list of contact notices that the caller acknowledges. The notices - * required here depend on the values specified in + * needed here depend on the values specified in * `registration.contact_settings`. * For allowed values, use constants defined on {@see \Google\Cloud\Domains\V1beta1\ContactNotice} * @type bool $validateOnly - * When true, only validation will be performed, without actually registering + * When true, only validation is performed, without actually registering * the domain. Follows: * https://cloud.google.com/apis/design/design_patterns#request_validation * @type RetrySettings|array $retrySettings @@ -1187,6 +1201,56 @@ public function retrieveRegisterParameters($domainName, $location, array $option return $this->startCall('RetrieveRegisterParameters', RetrieveRegisterParametersResponse::class, $optionalArgs, $request)->wait(); } + /** + * Gets parameters needed to transfer a domain name from another registrar to + * Cloud Domains. For domains managed by Google Domains, transferring to Cloud + * Domains is not supported. + * + * + * Use the returned values to call `TransferDomain`. + * + * Sample code: + * ``` + * $domainsClient = new DomainsClient(); + * try { + * $domainName = 'domain_name'; + * $formattedLocation = $domainsClient->locationName('[PROJECT]', '[LOCATION]'); + * $response = $domainsClient->retrieveTransferParameters($domainName, $formattedLocation); + * } finally { + * $domainsClient->close(); + * } + * ``` + * + * @param string $domainName Required. The domain name. Unicode domain names must be expressed in Punycode format. + * @param string $location Required. The location. Must be in the format `projects/*/locations/*`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Domains\V1beta1\RetrieveTransferParametersResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function retrieveTransferParameters($domainName, $location, array $optionalArgs = []) + { + $request = new RetrieveTransferParametersRequest(); + $requestParamHeaders = []; + $request->setDomainName($domainName); + $request->setLocation($location); + $requestParamHeaders['location'] = $location; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('RetrieveTransferParameters', RetrieveTransferParametersResponse::class, $optionalArgs, $request)->wait(); + } + /** * Searches for available domain names similar to the provided query. * @@ -1236,6 +1300,130 @@ public function searchDomains($query, $location, array $optionalArgs = []) return $this->startCall('SearchDomains', SearchDomainsResponse::class, $optionalArgs, $request)->wait(); } + /** + * Transfers a domain name from another registrar to Cloud Domains. For + * domains managed by Google Domains, transferring to Cloud Domains is not + * supported. + * + * + * Before calling this method, go to the domain's current registrar to unlock + * the domain for transfer and retrieve the domain's transfer authorization + * code. Then call `RetrieveTransferParameters` to confirm that the domain is + * unlocked and to get values needed to build a call to this method. + * + * A successful call creates a `Registration` resource in state + * `TRANSFER_PENDING`. It can take several days to complete the transfer + * process. The registrant can often speed up this process by approving the + * transfer through the current registrar, either by clicking a link in an + * email from the registrar or by visiting the registrar's website. + * + * A few minutes after transfer approval, the resource transitions to state + * `ACTIVE`, indicating that the transfer was successful. If the transfer is + * rejected or the request expires without being approved, the resource can + * end up in state `TRANSFER_FAILED`. If transfer fails, you can safely delete + * the resource and retry the transfer. + * + * Sample code: + * ``` + * $domainsClient = new DomainsClient(); + * try { + * $formattedParent = $domainsClient->locationName('[PROJECT]', '[LOCATION]'); + * $registration = new Registration(); + * $yearlyPrice = new Money(); + * $operationResponse = $domainsClient->transferDomain($formattedParent, $registration, $yearlyPrice); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $domainsClient->transferDomain($formattedParent, $registration, $yearlyPrice); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $domainsClient->resumeOperation($operationName, 'transferDomain'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $domainsClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource of the `Registration`. Must be in the + * format `projects/*/locations/*`. + * @param Registration $registration Required. The complete `Registration` resource to be created. + * + * You can leave `registration.dns_settings` unset to import the + * domain's current DNS configuration from its current registrar. Use this + * option only if you are sure that the domain's current DNS service + * does not cease upon transfer, as is often the case for DNS services + * provided for free by the registrar. + * @param Money $yearlyPrice Required. Acknowledgement of the price to transfer or renew the domain for one year. + * Call `RetrieveTransferParameters` to obtain the price, which you must + * acknowledge. + * @param array $optionalArgs { + * Optional. + * + * @type int[] $contactNotices + * The list of contact notices that you acknowledge. The notices + * needed here depend on the values specified in + * `registration.contact_settings`. + * For allowed values, use constants defined on {@see \Google\Cloud\Domains\V1beta1\ContactNotice} + * @type AuthorizationCode $authorizationCode + * The domain's transfer authorization code. You can obtain this from the + * domain's current registrar. + * @type bool $validateOnly + * Validate the request without actually transferring the domain. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function transferDomain($parent, $registration, $yearlyPrice, array $optionalArgs = []) + { + $request = new TransferDomainRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setRegistration($registration); + $request->setYearlyPrice($yearlyPrice); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['contactNotices'])) { + $request->setContactNotices($optionalArgs['contactNotices']); + } + + if (isset($optionalArgs['authorizationCode'])) { + $request->setAuthorizationCode($optionalArgs['authorizationCode']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('TransferDomain', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + /** * Updates select fields of a `Registration` resource, notably `labels`. To * update other fields, use the appropriate custom update method: @@ -1281,8 +1469,8 @@ public function searchDomains($query, $location, array $optionalArgs = []) * ``` * * @param FieldMask $updateMask Required. The field mask describing which fields to update as a comma-separated list. - * For example, if only the labels are being updated, the `update_mask` would - * be `"labels"`. + * For example, if only the labels are being updated, the `update_mask` is + * `"labels"`. * @param array $optionalArgs { * Optional. * diff --git a/Domains/src/V1beta1/ManagementSettings/RenewalMethod.php b/Domains/src/V1beta1/ManagementSettings/RenewalMethod.php index 985f0e34d005..74dc84e1f2a7 100644 --- a/Domains/src/V1beta1/ManagementSettings/RenewalMethod.php +++ b/Domains/src/V1beta1/ManagementSettings/RenewalMethod.php @@ -21,8 +21,8 @@ class RenewalMethod const RENEWAL_METHOD_UNSPECIFIED = 0; /** * The domain is automatically renewed each year . - * To disable automatic renewals, export the domain by calling - * `ExportRegistration` . + * To disable automatic renewals, delete the resource by calling + * `DeleteRegistration` or export it by calling `ExportRegistration`. * * Generated from protobuf enum AUTOMATIC_RENEWAL = 1; */ @@ -65,6 +65,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RenewalMethod::class, \Google\Cloud\Domains\V1beta1\ManagementSettings_RenewalMethod::class); diff --git a/Domains/src/V1beta1/OperationMetadata.php b/Domains/src/V1beta1/OperationMetadata.php index 4a75949d1008..5fc90a996426 100644 --- a/Domains/src/V1beta1/OperationMetadata.php +++ b/Domains/src/V1beta1/OperationMetadata.php @@ -85,7 +85,7 @@ public function __construct($data = NULL) { */ public function getCreateTime() { - return isset($this->create_time) ? $this->create_time : null; + return $this->create_time; } public function hasCreateTime() @@ -121,7 +121,7 @@ public function setCreateTime($var) */ public function getEndTime() { - return isset($this->end_time) ? $this->end_time : null; + return $this->end_time; } public function hasEndTime() diff --git a/Domains/src/V1beta1/RegisterDomainRequest.php b/Domains/src/V1beta1/RegisterDomainRequest.php index 8b10ad6d4f43..91827a745e43 100644 --- a/Domains/src/V1beta1/RegisterDomainRequest.php +++ b/Domains/src/V1beta1/RegisterDomainRequest.php @@ -37,7 +37,7 @@ class RegisterDomainRequest extends \Google\Protobuf\Internal\Message private $domain_notices; /** * The list of contact notices that the caller acknowledges. The notices - * required here depend on the values specified in + * needed here depend on the values specified in * `registration.contact_settings`. * * Generated from protobuf field repeated .google.cloud.domains.v1beta1.ContactNotice contact_notices = 4; @@ -52,7 +52,7 @@ class RegisterDomainRequest extends \Google\Protobuf\Internal\Message */ private $yearly_price = null; /** - * When true, only validation will be performed, without actually registering + * When true, only validation is performed, without actually registering * the domain. Follows: * https://cloud.google.com/apis/design/design_patterns#request_validation * @@ -76,14 +76,14 @@ class RegisterDomainRequest extends \Google\Protobuf\Internal\Message * `RetrieveRegisterParameters` to see the notices that need acknowledgement. * @type int[]|\Google\Protobuf\Internal\RepeatedField $contact_notices * The list of contact notices that the caller acknowledges. The notices - * required here depend on the values specified in + * needed here depend on the values specified in * `registration.contact_settings`. * @type \Google\Type\Money $yearly_price * Required. Yearly price to register or renew the domain. * The value that should be put here can be obtained from * RetrieveRegisterParameters or SearchDomains calls. * @type bool $validate_only - * When true, only validation will be performed, without actually registering + * When true, only validation is performed, without actually registering * the domain. Follows: * https://cloud.google.com/apis/design/design_patterns#request_validation * } @@ -129,7 +129,7 @@ public function setParent($var) */ public function getRegistration() { - return isset($this->registration) ? $this->registration : null; + return $this->registration; } public function hasRegistration() @@ -187,7 +187,7 @@ public function setDomainNotices($var) /** * The list of contact notices that the caller acknowledges. The notices - * required here depend on the values specified in + * needed here depend on the values specified in * `registration.contact_settings`. * * Generated from protobuf field repeated .google.cloud.domains.v1beta1.ContactNotice contact_notices = 4; @@ -200,7 +200,7 @@ public function getContactNotices() /** * The list of contact notices that the caller acknowledges. The notices - * required here depend on the values specified in + * needed here depend on the values specified in * `registration.contact_settings`. * * Generated from protobuf field repeated .google.cloud.domains.v1beta1.ContactNotice contact_notices = 4; @@ -225,7 +225,7 @@ public function setContactNotices($var) */ public function getYearlyPrice() { - return isset($this->yearly_price) ? $this->yearly_price : null; + return $this->yearly_price; } public function hasYearlyPrice() @@ -256,7 +256,7 @@ public function setYearlyPrice($var) } /** - * When true, only validation will be performed, without actually registering + * When true, only validation is performed, without actually registering * the domain. Follows: * https://cloud.google.com/apis/design/design_patterns#request_validation * @@ -269,7 +269,7 @@ public function getValidateOnly() } /** - * When true, only validation will be performed, without actually registering + * When true, only validation is performed, without actually registering * the domain. Follows: * https://cloud.google.com/apis/design/design_patterns#request_validation * diff --git a/Domains/src/V1beta1/RegisterParameters.php b/Domains/src/V1beta1/RegisterParameters.php index 14593c049ddc..efe1e5dde3e9 100644 --- a/Domains/src/V1beta1/RegisterParameters.php +++ b/Domains/src/V1beta1/RegisterParameters.php @@ -189,7 +189,7 @@ public function setDomainNotices($var) */ public function getYearlyPrice() { - return isset($this->yearly_price) ? $this->yearly_price : null; + return $this->yearly_price; } public function hasYearlyPrice() diff --git a/Domains/src/V1beta1/RegisterParameters/Availability.php b/Domains/src/V1beta1/RegisterParameters/Availability.php index 90b20eb551f5..b8e758f013b1 100644 --- a/Domains/src/V1beta1/RegisterParameters/Availability.php +++ b/Domains/src/V1beta1/RegisterParameters/Availability.php @@ -76,6 +76,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Availability::class, \Google\Cloud\Domains\V1beta1\RegisterParameters_Availability::class); diff --git a/Domains/src/V1beta1/Registration.php b/Domains/src/V1beta1/Registration.php index 2c4264824941..3d639e34c992 100644 --- a/Domains/src/V1beta1/Registration.php +++ b/Domains/src/V1beta1/Registration.php @@ -11,11 +11,17 @@ /** * The `Registration` resource facilitates managing and configuring domain name * registrations. + * There are several ways to create a new `Registration` resource: * To create a new `Registration` resource, find a suitable domain name by * calling the `SearchDomains` method with a query to see available domain name * options. After choosing a name, call `RetrieveRegisterParameters` to * ensure availability and obtain information like pricing, which is needed to * build a call to `RegisterDomain`. + * Another way to create a new `Registration` is to transfer an existing + * domain from another registrar. First, go to the current registrar to unlock + * the domain for transfer and retrieve the domain's transfer authorization + * code. Then call `RetrieveTransferParameters` to confirm that the domain is + * unlocked and to get values needed to build a call to `TransferDomain`. * * Generated from protobuf message google.cloud.domains.v1beta1.Registration */ @@ -94,7 +100,7 @@ class Registration extends \Google\Protobuf\Internal\Message * `contact_settings` field that change its `registrant_contact` or `privacy` * fields require email confirmation by the `registrant_contact` * before taking effect. This field is set only if there are pending updates - * to the `contact_settings` that have not yet been confirmed. To confirm the + * to the `contact_settings` that have not been confirmed. To confirm the * changes, the `registrant_contact` must follow the instructions in the * email they receive. * @@ -148,7 +154,7 @@ class Registration extends \Google\Protobuf\Internal\Message * `contact_settings` field that change its `registrant_contact` or `privacy` * fields require email confirmation by the `registrant_contact` * before taking effect. This field is set only if there are pending updates - * to the `contact_settings` that have not yet been confirmed. To confirm the + * to the `contact_settings` that have not been confirmed. To confirm the * changes, the `registrant_contact` must follow the instructions in the * email they receive. * @type int[]|\Google\Protobuf\Internal\RepeatedField $supported_privacy @@ -223,7 +229,7 @@ public function setDomainName($var) */ public function getCreateTime() { - return isset($this->create_time) ? $this->create_time : null; + return $this->create_time; } public function hasCreateTime() @@ -259,7 +265,7 @@ public function setCreateTime($var) */ public function getExpireTime() { - return isset($this->expire_time) ? $this->expire_time : null; + return $this->expire_time; } public function hasExpireTime() @@ -376,7 +382,7 @@ public function setLabels($var) */ public function getManagementSettings() { - return isset($this->management_settings) ? $this->management_settings : null; + return $this->management_settings; } public function hasManagementSettings() @@ -417,7 +423,7 @@ public function setManagementSettings($var) */ public function getDnsSettings() { - return isset($this->dns_settings) ? $this->dns_settings : null; + return $this->dns_settings; } public function hasDnsSettings() @@ -457,7 +463,7 @@ public function setDnsSettings($var) */ public function getContactSettings() { - return isset($this->contact_settings) ? $this->contact_settings : null; + return $this->contact_settings; } public function hasContactSettings() @@ -492,7 +498,7 @@ public function setContactSettings($var) * `contact_settings` field that change its `registrant_contact` or `privacy` * fields require email confirmation by the `registrant_contact` * before taking effect. This field is set only if there are pending updates - * to the `contact_settings` that have not yet been confirmed. To confirm the + * to the `contact_settings` that have not been confirmed. To confirm the * changes, the `registrant_contact` must follow the instructions in the * email they receive. * @@ -501,7 +507,7 @@ public function setContactSettings($var) */ public function getPendingContactSettings() { - return isset($this->pending_contact_settings) ? $this->pending_contact_settings : null; + return $this->pending_contact_settings; } public function hasPendingContactSettings() @@ -519,7 +525,7 @@ public function clearPendingContactSettings() * `contact_settings` field that change its `registrant_contact` or `privacy` * fields require email confirmation by the `registrant_contact` * before taking effect. This field is set only if there are pending updates - * to the `contact_settings` that have not yet been confirmed. To confirm the + * to the `contact_settings` that have not been confirmed. To confirm the * changes, the `registrant_contact` must follow the instructions in the * email they receive. * diff --git a/Domains/src/V1beta1/Registration/Issue.php b/Domains/src/V1beta1/Registration/Issue.php index 279c977125fe..58f414ec5370 100644 --- a/Domains/src/V1beta1/Registration/Issue.php +++ b/Domains/src/V1beta1/Registration/Issue.php @@ -31,7 +31,7 @@ class Issue * verify the email address, follow the * instructions in the email the `registrant_contact` receives following * registration. If you do not complete email verification within - * 14 days of registration, the domain is suspended. To resend the + * 15 days of registration, the domain is suspended. To resend the * verification email, call ConfigureContactSettings and provide the current * `registrant_contact.email`. * @@ -66,6 +66,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Issue::class, \Google\Cloud\Domains\V1beta1\Registration_Issue::class); diff --git a/Domains/src/V1beta1/Registration/State.php b/Domains/src/V1beta1/Registration/State.php index b0da1b134c12..f2d3263649f6 100644 --- a/Domains/src/V1beta1/Registration/State.php +++ b/Domains/src/V1beta1/Registration/State.php @@ -32,6 +32,20 @@ class State * Generated from protobuf enum REGISTRATION_FAILED = 2; */ const REGISTRATION_FAILED = 2; + /** + * The domain is being transferred from another registrar to Cloud Domains. + * + * Generated from protobuf enum TRANSFER_PENDING = 3; + */ + const TRANSFER_PENDING = 3; + /** + * The attempt to transfer the domain from another registrar to + * Cloud Domains failed. You can delete resources in this state and retry + * the transfer. + * + * Generated from protobuf enum TRANSFER_FAILED = 4; + */ + const TRANSFER_FAILED = 4; /** * The domain is registered and operational. The domain renews automatically * as long as it remains in this state. @@ -47,11 +61,11 @@ class State */ const SUSPENDED = 7; /** - * The domain has been exported from Cloud Domains to + * The domain is no longer managed with Cloud Domains. It may have been + * transferred to another registrar or exported for management in * [Google Domains](https://domains.google/). You can no longer update it - * with this API, and information shown about it may be stale. Without further action, domains in this - * state expire at their `expire_time`. You can delete the resource - * after the `expire_time` has passed. + * with this API, and information shown about it may be stale. Domains in + * this state are not automatically renewed by Cloud Domains. * * Generated from protobuf enum EXPORTED = 8; */ @@ -61,6 +75,8 @@ class State self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', self::REGISTRATION_PENDING => 'REGISTRATION_PENDING', self::REGISTRATION_FAILED => 'REGISTRATION_FAILED', + self::TRANSFER_PENDING => 'TRANSFER_PENDING', + self::TRANSFER_FAILED => 'TRANSFER_FAILED', self::ACTIVE => 'ACTIVE', self::SUSPENDED => 'SUSPENDED', self::EXPORTED => 'EXPORTED', @@ -87,6 +103,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Domains\V1beta1\Registration_State::class); diff --git a/Domains/src/V1beta1/RetrieveRegisterParametersResponse.php b/Domains/src/V1beta1/RetrieveRegisterParametersResponse.php index ae2e7fafdd86..ac833f7649b0 100644 --- a/Domains/src/V1beta1/RetrieveRegisterParametersResponse.php +++ b/Domains/src/V1beta1/RetrieveRegisterParametersResponse.php @@ -45,7 +45,7 @@ public function __construct($data = NULL) { */ public function getRegisterParameters() { - return isset($this->register_parameters) ? $this->register_parameters : null; + return $this->register_parameters; } public function hasRegisterParameters() diff --git a/Domains/src/V1beta1/RetrieveTransferParametersRequest.php b/Domains/src/V1beta1/RetrieveTransferParametersRequest.php new file mode 100644 index 000000000000..1602910cd9f3 --- /dev/null +++ b/Domains/src/V1beta1/RetrieveTransferParametersRequest.php @@ -0,0 +1,101 @@ +google.cloud.domains.v1beta1.RetrieveTransferParametersRequest + */ +class RetrieveTransferParametersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The domain name. Unicode domain names must be expressed in Punycode format. + * + * Generated from protobuf field string domain_name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $domain_name = ''; + /** + * Required. The location. Must be in the format `projects/*/locations/*`. + * + * Generated from protobuf field string location = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $location = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $domain_name + * Required. The domain name. Unicode domain names must be expressed in Punycode format. + * @type string $location + * Required. The location. Must be in the format `projects/*/locations/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Domains\V1Beta1\Domains::initOnce(); + parent::__construct($data); + } + + /** + * Required. The domain name. Unicode domain names must be expressed in Punycode format. + * + * Generated from protobuf field string domain_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDomainName() + { + return $this->domain_name; + } + + /** + * Required. The domain name. Unicode domain names must be expressed in Punycode format. + * + * Generated from protobuf field string domain_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDomainName($var) + { + GPBUtil::checkString($var, True); + $this->domain_name = $var; + + return $this; + } + + /** + * Required. The location. Must be in the format `projects/*/locations/*`. + * + * Generated from protobuf field string location = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * Required. The location. Must be in the format `projects/*/locations/*`. + * + * Generated from protobuf field string location = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + +} + diff --git a/Domains/src/V1beta1/RetrieveTransferParametersResponse.php b/Domains/src/V1beta1/RetrieveTransferParametersResponse.php new file mode 100644 index 000000000000..9c273095d8d3 --- /dev/null +++ b/Domains/src/V1beta1/RetrieveTransferParametersResponse.php @@ -0,0 +1,77 @@ +google.cloud.domains.v1beta1.RetrieveTransferParametersResponse + */ +class RetrieveTransferParametersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Parameters to use when calling the `TransferDomain` method. + * + * Generated from protobuf field .google.cloud.domains.v1beta1.TransferParameters transfer_parameters = 1; + */ + private $transfer_parameters = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Domains\V1beta1\TransferParameters $transfer_parameters + * Parameters to use when calling the `TransferDomain` method. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Domains\V1Beta1\Domains::initOnce(); + parent::__construct($data); + } + + /** + * Parameters to use when calling the `TransferDomain` method. + * + * Generated from protobuf field .google.cloud.domains.v1beta1.TransferParameters transfer_parameters = 1; + * @return \Google\Cloud\Domains\V1beta1\TransferParameters|null + */ + public function getTransferParameters() + { + return $this->transfer_parameters; + } + + public function hasTransferParameters() + { + return isset($this->transfer_parameters); + } + + public function clearTransferParameters() + { + unset($this->transfer_parameters); + } + + /** + * Parameters to use when calling the `TransferDomain` method. + * + * Generated from protobuf field .google.cloud.domains.v1beta1.TransferParameters transfer_parameters = 1; + * @param \Google\Cloud\Domains\V1beta1\TransferParameters $var + * @return $this + */ + public function setTransferParameters($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Domains\V1beta1\TransferParameters::class); + $this->transfer_parameters = $var; + + return $this; + } + +} + diff --git a/Domains/src/V1beta1/TransferDomainRequest.php b/Domains/src/V1beta1/TransferDomainRequest.php new file mode 100644 index 000000000000..cea3d379e236 --- /dev/null +++ b/Domains/src/V1beta1/TransferDomainRequest.php @@ -0,0 +1,311 @@ +google.cloud.domains.v1beta1.TransferDomainRequest + */ +class TransferDomainRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource of the `Registration`. Must be in the + * format `projects/*/locations/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * Required. The complete `Registration` resource to be created. + * You can leave `registration.dns_settings` unset to import the + * domain's current DNS configuration from its current registrar. Use this + * option only if you are sure that the domain's current DNS service + * does not cease upon transfer, as is often the case for DNS services + * provided for free by the registrar. + * + * Generated from protobuf field .google.cloud.domains.v1beta1.Registration registration = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $registration = null; + /** + * The list of contact notices that you acknowledge. The notices + * needed here depend on the values specified in + * `registration.contact_settings`. + * + * Generated from protobuf field repeated .google.cloud.domains.v1beta1.ContactNotice contact_notices = 3; + */ + private $contact_notices; + /** + * Required. Acknowledgement of the price to transfer or renew the domain for one year. + * Call `RetrieveTransferParameters` to obtain the price, which you must + * acknowledge. + * + * Generated from protobuf field .google.type.Money yearly_price = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $yearly_price = null; + /** + * The domain's transfer authorization code. You can obtain this from the + * domain's current registrar. + * + * Generated from protobuf field .google.cloud.domains.v1beta1.AuthorizationCode authorization_code = 5; + */ + private $authorization_code = null; + /** + * Validate the request without actually transferring the domain. + * + * Generated from protobuf field bool validate_only = 6; + */ + private $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource of the `Registration`. Must be in the + * format `projects/*/locations/*`. + * @type \Google\Cloud\Domains\V1beta1\Registration $registration + * Required. The complete `Registration` resource to be created. + * You can leave `registration.dns_settings` unset to import the + * domain's current DNS configuration from its current registrar. Use this + * option only if you are sure that the domain's current DNS service + * does not cease upon transfer, as is often the case for DNS services + * provided for free by the registrar. + * @type int[]|\Google\Protobuf\Internal\RepeatedField $contact_notices + * The list of contact notices that you acknowledge. The notices + * needed here depend on the values specified in + * `registration.contact_settings`. + * @type \Google\Type\Money $yearly_price + * Required. Acknowledgement of the price to transfer or renew the domain for one year. + * Call `RetrieveTransferParameters` to obtain the price, which you must + * acknowledge. + * @type \Google\Cloud\Domains\V1beta1\AuthorizationCode $authorization_code + * The domain's transfer authorization code. You can obtain this from the + * domain's current registrar. + * @type bool $validate_only + * Validate the request without actually transferring the domain. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Domains\V1Beta1\Domains::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource of the `Registration`. Must be in the + * format `projects/*/locations/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource of the `Registration`. Must be in the + * format `projects/*/locations/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The complete `Registration` resource to be created. + * You can leave `registration.dns_settings` unset to import the + * domain's current DNS configuration from its current registrar. Use this + * option only if you are sure that the domain's current DNS service + * does not cease upon transfer, as is often the case for DNS services + * provided for free by the registrar. + * + * Generated from protobuf field .google.cloud.domains.v1beta1.Registration registration = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Domains\V1beta1\Registration|null + */ + public function getRegistration() + { + return $this->registration; + } + + public function hasRegistration() + { + return isset($this->registration); + } + + public function clearRegistration() + { + unset($this->registration); + } + + /** + * Required. The complete `Registration` resource to be created. + * You can leave `registration.dns_settings` unset to import the + * domain's current DNS configuration from its current registrar. Use this + * option only if you are sure that the domain's current DNS service + * does not cease upon transfer, as is often the case for DNS services + * provided for free by the registrar. + * + * Generated from protobuf field .google.cloud.domains.v1beta1.Registration registration = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Domains\V1beta1\Registration $var + * @return $this + */ + public function setRegistration($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Domains\V1beta1\Registration::class); + $this->registration = $var; + + return $this; + } + + /** + * The list of contact notices that you acknowledge. The notices + * needed here depend on the values specified in + * `registration.contact_settings`. + * + * Generated from protobuf field repeated .google.cloud.domains.v1beta1.ContactNotice contact_notices = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getContactNotices() + { + return $this->contact_notices; + } + + /** + * The list of contact notices that you acknowledge. The notices + * needed here depend on the values specified in + * `registration.contact_settings`. + * + * Generated from protobuf field repeated .google.cloud.domains.v1beta1.ContactNotice contact_notices = 3; + * @param int[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setContactNotices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Domains\V1beta1\ContactNotice::class); + $this->contact_notices = $arr; + + return $this; + } + + /** + * Required. Acknowledgement of the price to transfer or renew the domain for one year. + * Call `RetrieveTransferParameters` to obtain the price, which you must + * acknowledge. + * + * Generated from protobuf field .google.type.Money yearly_price = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Type\Money|null + */ + public function getYearlyPrice() + { + return $this->yearly_price; + } + + public function hasYearlyPrice() + { + return isset($this->yearly_price); + } + + public function clearYearlyPrice() + { + unset($this->yearly_price); + } + + /** + * Required. Acknowledgement of the price to transfer or renew the domain for one year. + * Call `RetrieveTransferParameters` to obtain the price, which you must + * acknowledge. + * + * Generated from protobuf field .google.type.Money yearly_price = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Type\Money $var + * @return $this + */ + public function setYearlyPrice($var) + { + GPBUtil::checkMessage($var, \Google\Type\Money::class); + $this->yearly_price = $var; + + return $this; + } + + /** + * The domain's transfer authorization code. You can obtain this from the + * domain's current registrar. + * + * Generated from protobuf field .google.cloud.domains.v1beta1.AuthorizationCode authorization_code = 5; + * @return \Google\Cloud\Domains\V1beta1\AuthorizationCode|null + */ + public function getAuthorizationCode() + { + return $this->authorization_code; + } + + public function hasAuthorizationCode() + { + return isset($this->authorization_code); + } + + public function clearAuthorizationCode() + { + unset($this->authorization_code); + } + + /** + * The domain's transfer authorization code. You can obtain this from the + * domain's current registrar. + * + * Generated from protobuf field .google.cloud.domains.v1beta1.AuthorizationCode authorization_code = 5; + * @param \Google\Cloud\Domains\V1beta1\AuthorizationCode $var + * @return $this + */ + public function setAuthorizationCode($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Domains\V1beta1\AuthorizationCode::class); + $this->authorization_code = $var; + + return $this; + } + + /** + * Validate the request without actually transferring the domain. + * + * Generated from protobuf field bool validate_only = 6; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Validate the request without actually transferring the domain. + * + * Generated from protobuf field bool validate_only = 6; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/Domains/src/V1beta1/TransferParameters.php b/Domains/src/V1beta1/TransferParameters.php new file mode 100644 index 000000000000..443b7b8bd852 --- /dev/null +++ b/Domains/src/V1beta1/TransferParameters.php @@ -0,0 +1,255 @@ +google.cloud.domains.v1beta1.TransferParameters + */ +class TransferParameters extends \Google\Protobuf\Internal\Message +{ + /** + * The domain name. Unicode domain names are expressed in Punycode format. + * + * Generated from protobuf field string domain_name = 1; + */ + private $domain_name = ''; + /** + * The registrar that currently manages the domain. + * + * Generated from protobuf field string current_registrar = 2; + */ + private $current_registrar = ''; + /** + * The name servers that currently store the configuration of the domain. + * + * Generated from protobuf field repeated string name_servers = 3; + */ + private $name_servers; + /** + * Indicates whether the domain is protected by a transfer lock. For a + * transfer to succeed, this must show `UNLOCKED`. To unlock a domain, + * go to its current registrar. + * + * Generated from protobuf field .google.cloud.domains.v1beta1.TransferLockState transfer_lock_state = 4; + */ + private $transfer_lock_state = 0; + /** + * Contact privacy options that the domain supports. + * + * Generated from protobuf field repeated .google.cloud.domains.v1beta1.ContactPrivacy supported_privacy = 5; + */ + private $supported_privacy; + /** + * Price to transfer or renew the domain for one year. + * + * Generated from protobuf field .google.type.Money yearly_price = 6; + */ + private $yearly_price = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $domain_name + * The domain name. Unicode domain names are expressed in Punycode format. + * @type string $current_registrar + * The registrar that currently manages the domain. + * @type string[]|\Google\Protobuf\Internal\RepeatedField $name_servers + * The name servers that currently store the configuration of the domain. + * @type int $transfer_lock_state + * Indicates whether the domain is protected by a transfer lock. For a + * transfer to succeed, this must show `UNLOCKED`. To unlock a domain, + * go to its current registrar. + * @type int[]|\Google\Protobuf\Internal\RepeatedField $supported_privacy + * Contact privacy options that the domain supports. + * @type \Google\Type\Money $yearly_price + * Price to transfer or renew the domain for one year. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Domains\V1Beta1\Domains::initOnce(); + parent::__construct($data); + } + + /** + * The domain name. Unicode domain names are expressed in Punycode format. + * + * Generated from protobuf field string domain_name = 1; + * @return string + */ + public function getDomainName() + { + return $this->domain_name; + } + + /** + * The domain name. Unicode domain names are expressed in Punycode format. + * + * Generated from protobuf field string domain_name = 1; + * @param string $var + * @return $this + */ + public function setDomainName($var) + { + GPBUtil::checkString($var, True); + $this->domain_name = $var; + + return $this; + } + + /** + * The registrar that currently manages the domain. + * + * Generated from protobuf field string current_registrar = 2; + * @return string + */ + public function getCurrentRegistrar() + { + return $this->current_registrar; + } + + /** + * The registrar that currently manages the domain. + * + * Generated from protobuf field string current_registrar = 2; + * @param string $var + * @return $this + */ + public function setCurrentRegistrar($var) + { + GPBUtil::checkString($var, True); + $this->current_registrar = $var; + + return $this; + } + + /** + * The name servers that currently store the configuration of the domain. + * + * Generated from protobuf field repeated string name_servers = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNameServers() + { + return $this->name_servers; + } + + /** + * The name servers that currently store the configuration of the domain. + * + * Generated from protobuf field repeated string name_servers = 3; + * @param string[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNameServers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->name_servers = $arr; + + return $this; + } + + /** + * Indicates whether the domain is protected by a transfer lock. For a + * transfer to succeed, this must show `UNLOCKED`. To unlock a domain, + * go to its current registrar. + * + * Generated from protobuf field .google.cloud.domains.v1beta1.TransferLockState transfer_lock_state = 4; + * @return int + */ + public function getTransferLockState() + { + return $this->transfer_lock_state; + } + + /** + * Indicates whether the domain is protected by a transfer lock. For a + * transfer to succeed, this must show `UNLOCKED`. To unlock a domain, + * go to its current registrar. + * + * Generated from protobuf field .google.cloud.domains.v1beta1.TransferLockState transfer_lock_state = 4; + * @param int $var + * @return $this + */ + public function setTransferLockState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Domains\V1beta1\TransferLockState::class); + $this->transfer_lock_state = $var; + + return $this; + } + + /** + * Contact privacy options that the domain supports. + * + * Generated from protobuf field repeated .google.cloud.domains.v1beta1.ContactPrivacy supported_privacy = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSupportedPrivacy() + { + return $this->supported_privacy; + } + + /** + * Contact privacy options that the domain supports. + * + * Generated from protobuf field repeated .google.cloud.domains.v1beta1.ContactPrivacy supported_privacy = 5; + * @param int[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSupportedPrivacy($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Domains\V1beta1\ContactPrivacy::class); + $this->supported_privacy = $arr; + + return $this; + } + + /** + * Price to transfer or renew the domain for one year. + * + * Generated from protobuf field .google.type.Money yearly_price = 6; + * @return \Google\Type\Money|null + */ + public function getYearlyPrice() + { + return $this->yearly_price; + } + + public function hasYearlyPrice() + { + return isset($this->yearly_price); + } + + public function clearYearlyPrice() + { + unset($this->yearly_price); + } + + /** + * Price to transfer or renew the domain for one year. + * + * Generated from protobuf field .google.type.Money yearly_price = 6; + * @param \Google\Type\Money $var + * @return $this + */ + public function setYearlyPrice($var) + { + GPBUtil::checkMessage($var, \Google\Type\Money::class); + $this->yearly_price = $var; + + return $this; + } + +} + diff --git a/Domains/src/V1beta1/UpdateRegistrationRequest.php b/Domains/src/V1beta1/UpdateRegistrationRequest.php index c6b881d592cd..6a50be990d54 100644 --- a/Domains/src/V1beta1/UpdateRegistrationRequest.php +++ b/Domains/src/V1beta1/UpdateRegistrationRequest.php @@ -23,8 +23,8 @@ class UpdateRegistrationRequest extends \Google\Protobuf\Internal\Message private $registration = null; /** * Required. The field mask describing which fields to update as a comma-separated list. - * For example, if only the labels are being updated, the `update_mask` would - * be `"labels"`. + * For example, if only the labels are being updated, the `update_mask` is + * `"labels"`. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; */ @@ -40,8 +40,8 @@ class UpdateRegistrationRequest extends \Google\Protobuf\Internal\Message * Fields of the `Registration` to update. * @type \Google\Protobuf\FieldMask $update_mask * Required. The field mask describing which fields to update as a comma-separated list. - * For example, if only the labels are being updated, the `update_mask` would - * be `"labels"`. + * For example, if only the labels are being updated, the `update_mask` is + * `"labels"`. * } */ public function __construct($data = NULL) { @@ -57,7 +57,7 @@ public function __construct($data = NULL) { */ public function getRegistration() { - return isset($this->registration) ? $this->registration : null; + return $this->registration; } public function hasRegistration() @@ -87,15 +87,15 @@ public function setRegistration($var) /** * Required. The field mask describing which fields to update as a comma-separated list. - * For example, if only the labels are being updated, the `update_mask` would - * be `"labels"`. + * For example, if only the labels are being updated, the `update_mask` is + * `"labels"`. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; * @return \Google\Protobuf\FieldMask|null */ public function getUpdateMask() { - return isset($this->update_mask) ? $this->update_mask : null; + return $this->update_mask; } public function hasUpdateMask() @@ -110,8 +110,8 @@ public function clearUpdateMask() /** * Required. The field mask describing which fields to update as a comma-separated list. - * For example, if only the labels are being updated, the `update_mask` would - * be `"labels"`. + * For example, if only the labels are being updated, the `update_mask` is + * `"labels"`. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; * @param \Google\Protobuf\FieldMask $var diff --git a/Domains/src/V1beta1/gapic_metadata.json b/Domains/src/V1beta1/gapic_metadata.json index e65985a3b81c..fd839fab3d82 100644 --- a/Domains/src/V1beta1/gapic_metadata.json +++ b/Domains/src/V1beta1/gapic_metadata.json @@ -65,11 +65,21 @@ "retrieveRegisterParameters" ] }, + "RetrieveTransferParameters": { + "methods": [ + "retrieveTransferParameters" + ] + }, "SearchDomains": { "methods": [ "searchDomains" ] }, + "TransferDomain": { + "methods": [ + "transferDomain" + ] + }, "UpdateRegistration": { "methods": [ "updateRegistration" diff --git a/Domains/src/V1beta1/resources/domains_client_config.json b/Domains/src/V1beta1/resources/domains_client_config.json index 35b58b384919..26b7a889c460 100644 --- a/Domains/src/V1beta1/resources/domains_client_config.json +++ b/Domains/src/V1beta1/resources/domains_client_config.json @@ -93,11 +93,21 @@ "retry_codes_name": "no_retry_codes", "retry_params_name": "no_retry_params" }, + "RetrieveTransferParameters": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "SearchDomains": { "timeout_millis": 60000, "retry_codes_name": "no_retry_codes", "retry_params_name": "no_retry_params" }, + "TransferDomain": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "UpdateRegistration": { "timeout_millis": 60000, "retry_codes_name": "no_retry_codes", diff --git a/Domains/src/V1beta1/resources/domains_descriptor_config.php b/Domains/src/V1beta1/resources/domains_descriptor_config.php index c0cbff2039e9..e243d0114897 100644 --- a/Domains/src/V1beta1/resources/domains_descriptor_config.php +++ b/Domains/src/V1beta1/resources/domains_descriptor_config.php @@ -63,6 +63,16 @@ 'totalPollTimeoutMillis' => '300000', ], ], + 'TransferDomain' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Domains\V1beta1\Registration', + 'metadataReturnType' => '\Google\Cloud\Domains\V1beta1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], 'UpdateRegistration' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\Domains\V1beta1\Registration', diff --git a/Domains/src/V1beta1/resources/domains_rest_client_config.php b/Domains/src/V1beta1/resources/domains_rest_client_config.php index c72967c8ee17..a75708556b1a 100644 --- a/Domains/src/V1beta1/resources/domains_rest_client_config.php +++ b/Domains/src/V1beta1/resources/domains_rest_client_config.php @@ -130,6 +130,17 @@ ], ], ], + 'RetrieveTransferParameters' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{location=projects/*/locations/*}/registrations:retrieveTransferParameters', + 'placeholders' => [ + 'location' => [ + 'getters' => [ + 'getLocation', + ], + ], + ], + ], 'SearchDomains' => [ 'method' => 'get', 'uriTemplate' => '/v1beta1/{location=projects/*/locations/*}/registrations:searchDomains', @@ -141,6 +152,18 @@ ], ], ], + 'TransferDomain' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*}/registrations:transfer', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'UpdateRegistration' => [ 'method' => 'patch', 'uriTemplate' => '/v1beta1/{registration.name=projects/*/locations/*/registrations/*}', @@ -153,12 +176,15 @@ ], ], ], + 'queryParams' => [ + 'update_mask', + ], ], ], - 'google.longrunning.Operations' => [ - 'ListOperations' => [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*}/operations', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*}', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -167,9 +193,9 @@ ], ], ], - 'GetOperation' => [ + 'ListLocations' => [ 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/operations/*}', + 'uriTemplate' => '/v1beta1/{name=projects/*}/locations', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -178,8 +204,47 @@ ], ], ], - 'DeleteOperation' => [ - 'method' => 'delete', + ], + 'google.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/registrations/*}:getIamPolicy', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/registrations/*}:setIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/registrations/*}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/operations/*}', 'placeholders' => [ 'name' => [ @@ -189,9 +254,9 @@ ], ], ], - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel', + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*}/operations', 'placeholders' => [ 'name' => [ 'getters' => [ diff --git a/Domains/tests/Unit/V1alpha2/DomainsClientTest.php b/Domains/tests/Unit/V1alpha2/DomainsClientTest.php index 380456176225..75df6ccfbdc0 100644 --- a/Domains/tests/Unit/V1alpha2/DomainsClientTest.php +++ b/Domains/tests/Unit/V1alpha2/DomainsClientTest.php @@ -38,6 +38,7 @@ use Google\Cloud\Domains\V1alpha2\ListRegistrationsResponse; use Google\Cloud\Domains\V1alpha2\Registration; use Google\Cloud\Domains\V1alpha2\RetrieveRegisterParametersResponse; +use Google\Cloud\Domains\V1alpha2\RetrieveTransferParametersResponse; use Google\Cloud\Domains\V1alpha2\SearchDomainsResponse; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; @@ -1241,6 +1242,72 @@ public function retrieveRegisterParametersExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** + * @test + */ + public function retrieveTransferParametersTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new RetrieveTransferParametersResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $domainName = 'domainName104118566'; + $formattedLocation = $client->locationName('[PROJECT]', '[LOCATION]'); + $response = $client->retrieveTransferParameters($domainName, $formattedLocation); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.domains.v1alpha2.Domains/RetrieveTransferParameters', $actualFuncCall); + $actualValue = $actualRequestObject->getDomainName(); + $this->assertProtobufEquals($domainName, $actualValue); + $actualValue = $actualRequestObject->getLocation(); + $this->assertProtobufEquals($formattedLocation, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function retrieveTransferParametersExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $domainName = 'domainName104118566'; + $formattedLocation = $client->locationName('[PROJECT]', '[LOCATION]'); + try { + $client->retrieveTransferParameters($domainName, $formattedLocation); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** * @test */ @@ -1307,6 +1374,199 @@ public function searchDomainsExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** + * @test + */ + public function transferDomainTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/transferDomainTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $domainName = 'domainName104118566'; + $expectedResponse = new Registration(); + $expectedResponse->setName($name); + $expectedResponse->setDomainName($domainName); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/transferDomainTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); + $registration = new Registration(); + $registrationDomainName = 'registrationDomainName1873916680'; + $registration->setDomainName($registrationDomainName); + $registrationContactSettings = new ContactSettings(); + $contactSettingsPrivacy = ContactPrivacy::CONTACT_PRIVACY_UNSPECIFIED; + $registrationContactSettings->setPrivacy($contactSettingsPrivacy); + $contactSettingsRegistrantContact = new Contact(); + $registrantContactPostalAddress = new PostalAddress(); + $contactSettingsRegistrantContact->setPostalAddress($registrantContactPostalAddress); + $registrantContactEmail = 'registrantContactEmail1001340839'; + $contactSettingsRegistrantContact->setEmail($registrantContactEmail); + $registrantContactPhoneNumber = 'registrantContactPhoneNumber-2077279710'; + $contactSettingsRegistrantContact->setPhoneNumber($registrantContactPhoneNumber); + $registrationContactSettings->setRegistrantContact($contactSettingsRegistrantContact); + $contactSettingsAdminContact = new Contact(); + $adminContactPostalAddress = new PostalAddress(); + $contactSettingsAdminContact->setPostalAddress($adminContactPostalAddress); + $adminContactEmail = 'adminContactEmail1687004235'; + $contactSettingsAdminContact->setEmail($adminContactEmail); + $adminContactPhoneNumber = 'adminContactPhoneNumber-516910138'; + $contactSettingsAdminContact->setPhoneNumber($adminContactPhoneNumber); + $registrationContactSettings->setAdminContact($contactSettingsAdminContact); + $contactSettingsTechnicalContact = new Contact(); + $technicalContactPostalAddress = new PostalAddress(); + $contactSettingsTechnicalContact->setPostalAddress($technicalContactPostalAddress); + $technicalContactEmail = 'technicalContactEmail-221168807'; + $contactSettingsTechnicalContact->setEmail($technicalContactEmail); + $technicalContactPhoneNumber = 'technicalContactPhoneNumber582887508'; + $contactSettingsTechnicalContact->setPhoneNumber($technicalContactPhoneNumber); + $registrationContactSettings->setTechnicalContact($contactSettingsTechnicalContact); + $registration->setContactSettings($registrationContactSettings); + $yearlyPrice = new Money(); + $response = $client->transferDomain($formattedParent, $registration, $yearlyPrice); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.domains.v1alpha2.Domains/TransferDomain', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getRegistration(); + $this->assertProtobufEquals($registration, $actualValue); + $actualValue = $actualApiRequestObject->getYearlyPrice(); + $this->assertProtobufEquals($yearlyPrice, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/transferDomainTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** + * @test + */ + public function transferDomainExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/transferDomainTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); + $registration = new Registration(); + $registrationDomainName = 'registrationDomainName1873916680'; + $registration->setDomainName($registrationDomainName); + $registrationContactSettings = new ContactSettings(); + $contactSettingsPrivacy = ContactPrivacy::CONTACT_PRIVACY_UNSPECIFIED; + $registrationContactSettings->setPrivacy($contactSettingsPrivacy); + $contactSettingsRegistrantContact = new Contact(); + $registrantContactPostalAddress = new PostalAddress(); + $contactSettingsRegistrantContact->setPostalAddress($registrantContactPostalAddress); + $registrantContactEmail = 'registrantContactEmail1001340839'; + $contactSettingsRegistrantContact->setEmail($registrantContactEmail); + $registrantContactPhoneNumber = 'registrantContactPhoneNumber-2077279710'; + $contactSettingsRegistrantContact->setPhoneNumber($registrantContactPhoneNumber); + $registrationContactSettings->setRegistrantContact($contactSettingsRegistrantContact); + $contactSettingsAdminContact = new Contact(); + $adminContactPostalAddress = new PostalAddress(); + $contactSettingsAdminContact->setPostalAddress($adminContactPostalAddress); + $adminContactEmail = 'adminContactEmail1687004235'; + $contactSettingsAdminContact->setEmail($adminContactEmail); + $adminContactPhoneNumber = 'adminContactPhoneNumber-516910138'; + $contactSettingsAdminContact->setPhoneNumber($adminContactPhoneNumber); + $registrationContactSettings->setAdminContact($contactSettingsAdminContact); + $contactSettingsTechnicalContact = new Contact(); + $technicalContactPostalAddress = new PostalAddress(); + $contactSettingsTechnicalContact->setPostalAddress($technicalContactPostalAddress); + $technicalContactEmail = 'technicalContactEmail-221168807'; + $contactSettingsTechnicalContact->setEmail($technicalContactEmail); + $technicalContactPhoneNumber = 'technicalContactPhoneNumber582887508'; + $contactSettingsTechnicalContact->setPhoneNumber($technicalContactPhoneNumber); + $registrationContactSettings->setTechnicalContact($contactSettingsTechnicalContact); + $registration->setContactSettings($registrationContactSettings); + $yearlyPrice = new Money(); + $response = $client->transferDomain($formattedParent, $registration, $yearlyPrice); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/transferDomainTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** * @test */ diff --git a/Domains/tests/Unit/V1beta1/DomainsClientTest.php b/Domains/tests/Unit/V1beta1/DomainsClientTest.php index 231af21eb2f0..df86b8f31972 100644 --- a/Domains/tests/Unit/V1beta1/DomainsClientTest.php +++ b/Domains/tests/Unit/V1beta1/DomainsClientTest.php @@ -38,6 +38,7 @@ use Google\Cloud\Domains\V1beta1\ListRegistrationsResponse; use Google\Cloud\Domains\V1beta1\Registration; use Google\Cloud\Domains\V1beta1\RetrieveRegisterParametersResponse; +use Google\Cloud\Domains\V1beta1\RetrieveTransferParametersResponse; use Google\Cloud\Domains\V1beta1\SearchDomainsResponse; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; @@ -1241,6 +1242,72 @@ public function retrieveRegisterParametersExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** + * @test + */ + public function retrieveTransferParametersTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new RetrieveTransferParametersResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $domainName = 'domainName104118566'; + $formattedLocation = $client->locationName('[PROJECT]', '[LOCATION]'); + $response = $client->retrieveTransferParameters($domainName, $formattedLocation); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.domains.v1beta1.Domains/RetrieveTransferParameters', $actualFuncCall); + $actualValue = $actualRequestObject->getDomainName(); + $this->assertProtobufEquals($domainName, $actualValue); + $actualValue = $actualRequestObject->getLocation(); + $this->assertProtobufEquals($formattedLocation, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function retrieveTransferParametersExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $domainName = 'domainName104118566'; + $formattedLocation = $client->locationName('[PROJECT]', '[LOCATION]'); + try { + $client->retrieveTransferParameters($domainName, $formattedLocation); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** * @test */ @@ -1307,6 +1374,199 @@ public function searchDomainsExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** + * @test + */ + public function transferDomainTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/transferDomainTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $domainName = 'domainName104118566'; + $expectedResponse = new Registration(); + $expectedResponse->setName($name); + $expectedResponse->setDomainName($domainName); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/transferDomainTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); + $registration = new Registration(); + $registrationDomainName = 'registrationDomainName1873916680'; + $registration->setDomainName($registrationDomainName); + $registrationContactSettings = new ContactSettings(); + $contactSettingsPrivacy = ContactPrivacy::CONTACT_PRIVACY_UNSPECIFIED; + $registrationContactSettings->setPrivacy($contactSettingsPrivacy); + $contactSettingsRegistrantContact = new Contact(); + $registrantContactPostalAddress = new PostalAddress(); + $contactSettingsRegistrantContact->setPostalAddress($registrantContactPostalAddress); + $registrantContactEmail = 'registrantContactEmail1001340839'; + $contactSettingsRegistrantContact->setEmail($registrantContactEmail); + $registrantContactPhoneNumber = 'registrantContactPhoneNumber-2077279710'; + $contactSettingsRegistrantContact->setPhoneNumber($registrantContactPhoneNumber); + $registrationContactSettings->setRegistrantContact($contactSettingsRegistrantContact); + $contactSettingsAdminContact = new Contact(); + $adminContactPostalAddress = new PostalAddress(); + $contactSettingsAdminContact->setPostalAddress($adminContactPostalAddress); + $adminContactEmail = 'adminContactEmail1687004235'; + $contactSettingsAdminContact->setEmail($adminContactEmail); + $adminContactPhoneNumber = 'adminContactPhoneNumber-516910138'; + $contactSettingsAdminContact->setPhoneNumber($adminContactPhoneNumber); + $registrationContactSettings->setAdminContact($contactSettingsAdminContact); + $contactSettingsTechnicalContact = new Contact(); + $technicalContactPostalAddress = new PostalAddress(); + $contactSettingsTechnicalContact->setPostalAddress($technicalContactPostalAddress); + $technicalContactEmail = 'technicalContactEmail-221168807'; + $contactSettingsTechnicalContact->setEmail($technicalContactEmail); + $technicalContactPhoneNumber = 'technicalContactPhoneNumber582887508'; + $contactSettingsTechnicalContact->setPhoneNumber($technicalContactPhoneNumber); + $registrationContactSettings->setTechnicalContact($contactSettingsTechnicalContact); + $registration->setContactSettings($registrationContactSettings); + $yearlyPrice = new Money(); + $response = $client->transferDomain($formattedParent, $registration, $yearlyPrice); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.domains.v1beta1.Domains/TransferDomain', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getRegistration(); + $this->assertProtobufEquals($registration, $actualValue); + $actualValue = $actualApiRequestObject->getYearlyPrice(); + $this->assertProtobufEquals($yearlyPrice, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/transferDomainTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** + * @test + */ + public function transferDomainExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/transferDomainTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); + $registration = new Registration(); + $registrationDomainName = 'registrationDomainName1873916680'; + $registration->setDomainName($registrationDomainName); + $registrationContactSettings = new ContactSettings(); + $contactSettingsPrivacy = ContactPrivacy::CONTACT_PRIVACY_UNSPECIFIED; + $registrationContactSettings->setPrivacy($contactSettingsPrivacy); + $contactSettingsRegistrantContact = new Contact(); + $registrantContactPostalAddress = new PostalAddress(); + $contactSettingsRegistrantContact->setPostalAddress($registrantContactPostalAddress); + $registrantContactEmail = 'registrantContactEmail1001340839'; + $contactSettingsRegistrantContact->setEmail($registrantContactEmail); + $registrantContactPhoneNumber = 'registrantContactPhoneNumber-2077279710'; + $contactSettingsRegistrantContact->setPhoneNumber($registrantContactPhoneNumber); + $registrationContactSettings->setRegistrantContact($contactSettingsRegistrantContact); + $contactSettingsAdminContact = new Contact(); + $adminContactPostalAddress = new PostalAddress(); + $contactSettingsAdminContact->setPostalAddress($adminContactPostalAddress); + $adminContactEmail = 'adminContactEmail1687004235'; + $contactSettingsAdminContact->setEmail($adminContactEmail); + $adminContactPhoneNumber = 'adminContactPhoneNumber-516910138'; + $contactSettingsAdminContact->setPhoneNumber($adminContactPhoneNumber); + $registrationContactSettings->setAdminContact($contactSettingsAdminContact); + $contactSettingsTechnicalContact = new Contact(); + $technicalContactPostalAddress = new PostalAddress(); + $contactSettingsTechnicalContact->setPostalAddress($technicalContactPostalAddress); + $technicalContactEmail = 'technicalContactEmail-221168807'; + $contactSettingsTechnicalContact->setEmail($technicalContactEmail); + $technicalContactPhoneNumber = 'technicalContactPhoneNumber582887508'; + $contactSettingsTechnicalContact->setPhoneNumber($technicalContactPhoneNumber); + $registrationContactSettings->setTechnicalContact($contactSettingsTechnicalContact); + $registration->setContactSettings($registrationContactSettings); + $yearlyPrice = new Money(); + $response = $client->transferDomain($formattedParent, $registration, $yearlyPrice); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/transferDomainTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** * @test */