Skip to content

Commit

Permalink
feat: added library for Cloud Domains v1 API. Also added methods for …
Browse files Browse the repository at this point in the history
…the transfer-in flow docs: improved API comments

Added Cloud Domains v1 API.
Also added support for transferring already registered domains from 3rd party domain registrars to Cloud Domains.

PiperOrigin-RevId: 404189502

Source-Author: Google APIs <noreply@google.com>
Source-Date: Tue Oct 19 01:51:12 2021 -0700
Source-Repo: googleapis/googleapis
Source-Sha: 6990d971ba0c67996cd147e6c253cb84e3dc409d
Source-Link: googleapis/googleapis@6990d97
  • Loading branch information
yoshi-automation authored and jskeet committed Oct 19, 2021
1 parent f594b06 commit c35bada
Show file tree
Hide file tree
Showing 8 changed files with 3,765 additions and 883 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,138 @@ public void RetrieveRegisterParametersResourceNames()
mockGrpcClient.VerifyAll();
}

[xunit::FactAttribute]
public void RetrieveTransferParametersRequestObject()
{
moq::Mock<Domains.DomainsClient> mockGrpcClient = new moq::Mock<Domains.DomainsClient>(moq::MockBehavior.Strict);
mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object);
RetrieveTransferParametersRequest request = new RetrieveTransferParametersRequest
{
DomainName = "domain_nameea17a44f",
LocationAsLocationName = gagr::LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
RetrieveTransferParametersResponse expectedResponse = new RetrieveTransferParametersResponse
{
TransferParameters = new TransferParameters(),
};
mockGrpcClient.Setup(x => x.RetrieveTransferParameters(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
DomainsClient client = new DomainsClientImpl(mockGrpcClient.Object, null);
RetrieveTransferParametersResponse response = client.RetrieveTransferParameters(request);
xunit::Assert.Same(expectedResponse, response);
mockGrpcClient.VerifyAll();
}

[xunit::FactAttribute]
public async stt::Task RetrieveTransferParametersRequestObjectAsync()
{
moq::Mock<Domains.DomainsClient> mockGrpcClient = new moq::Mock<Domains.DomainsClient>(moq::MockBehavior.Strict);
mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object);
RetrieveTransferParametersRequest request = new RetrieveTransferParametersRequest
{
DomainName = "domain_nameea17a44f",
LocationAsLocationName = gagr::LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
RetrieveTransferParametersResponse expectedResponse = new RetrieveTransferParametersResponse
{
TransferParameters = new TransferParameters(),
};
mockGrpcClient.Setup(x => x.RetrieveTransferParametersAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<RetrieveTransferParametersResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
DomainsClient client = new DomainsClientImpl(mockGrpcClient.Object, null);
RetrieveTransferParametersResponse responseCallSettings = await client.RetrieveTransferParametersAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));
xunit::Assert.Same(expectedResponse, responseCallSettings);
RetrieveTransferParametersResponse responseCancellationToken = await client.RetrieveTransferParametersAsync(request, st::CancellationToken.None);
xunit::Assert.Same(expectedResponse, responseCancellationToken);
mockGrpcClient.VerifyAll();
}

[xunit::FactAttribute]
public void RetrieveTransferParameters()
{
moq::Mock<Domains.DomainsClient> mockGrpcClient = new moq::Mock<Domains.DomainsClient>(moq::MockBehavior.Strict);
mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object);
RetrieveTransferParametersRequest request = new RetrieveTransferParametersRequest
{
DomainName = "domain_nameea17a44f",
LocationAsLocationName = gagr::LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
RetrieveTransferParametersResponse expectedResponse = new RetrieveTransferParametersResponse
{
TransferParameters = new TransferParameters(),
};
mockGrpcClient.Setup(x => x.RetrieveTransferParameters(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
DomainsClient client = new DomainsClientImpl(mockGrpcClient.Object, null);
RetrieveTransferParametersResponse response = client.RetrieveTransferParameters(request.Location, request.DomainName);
xunit::Assert.Same(expectedResponse, response);
mockGrpcClient.VerifyAll();
}

[xunit::FactAttribute]
public async stt::Task RetrieveTransferParametersAsync()
{
moq::Mock<Domains.DomainsClient> mockGrpcClient = new moq::Mock<Domains.DomainsClient>(moq::MockBehavior.Strict);
mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object);
RetrieveTransferParametersRequest request = new RetrieveTransferParametersRequest
{
DomainName = "domain_nameea17a44f",
LocationAsLocationName = gagr::LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
RetrieveTransferParametersResponse expectedResponse = new RetrieveTransferParametersResponse
{
TransferParameters = new TransferParameters(),
};
mockGrpcClient.Setup(x => x.RetrieveTransferParametersAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<RetrieveTransferParametersResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
DomainsClient client = new DomainsClientImpl(mockGrpcClient.Object, null);
RetrieveTransferParametersResponse responseCallSettings = await client.RetrieveTransferParametersAsync(request.Location, request.DomainName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));
xunit::Assert.Same(expectedResponse, responseCallSettings);
RetrieveTransferParametersResponse responseCancellationToken = await client.RetrieveTransferParametersAsync(request.Location, request.DomainName, st::CancellationToken.None);
xunit::Assert.Same(expectedResponse, responseCancellationToken);
mockGrpcClient.VerifyAll();
}

[xunit::FactAttribute]
public void RetrieveTransferParametersResourceNames()
{
moq::Mock<Domains.DomainsClient> mockGrpcClient = new moq::Mock<Domains.DomainsClient>(moq::MockBehavior.Strict);
mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object);
RetrieveTransferParametersRequest request = new RetrieveTransferParametersRequest
{
DomainName = "domain_nameea17a44f",
LocationAsLocationName = gagr::LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
RetrieveTransferParametersResponse expectedResponse = new RetrieveTransferParametersResponse
{
TransferParameters = new TransferParameters(),
};
mockGrpcClient.Setup(x => x.RetrieveTransferParameters(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
DomainsClient client = new DomainsClientImpl(mockGrpcClient.Object, null);
RetrieveTransferParametersResponse response = client.RetrieveTransferParameters(request.LocationAsLocationName, request.DomainName);
xunit::Assert.Same(expectedResponse, response);
mockGrpcClient.VerifyAll();
}

[xunit::FactAttribute]
public async stt::Task RetrieveTransferParametersResourceNamesAsync()
{
moq::Mock<Domains.DomainsClient> mockGrpcClient = new moq::Mock<Domains.DomainsClient>(moq::MockBehavior.Strict);
mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object);
RetrieveTransferParametersRequest request = new RetrieveTransferParametersRequest
{
DomainName = "domain_nameea17a44f",
LocationAsLocationName = gagr::LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
RetrieveTransferParametersResponse expectedResponse = new RetrieveTransferParametersResponse
{
TransferParameters = new TransferParameters(),
};
mockGrpcClient.Setup(x => x.RetrieveTransferParametersAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<RetrieveTransferParametersResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
DomainsClient client = new DomainsClientImpl(mockGrpcClient.Object, null);
RetrieveTransferParametersResponse responseCallSettings = await client.RetrieveTransferParametersAsync(request.LocationAsLocationName, request.DomainName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));
xunit::Assert.Same(expectedResponse, responseCallSettings);
RetrieveTransferParametersResponse responseCancellationToken = await client.RetrieveTransferParametersAsync(request.LocationAsLocationName, request.DomainName, st::CancellationToken.None);
xunit::Assert.Same(expectedResponse, responseCancellationToken);
mockGrpcClient.VerifyAll();
}

[xunit::FactAttribute]
public void GetRegistrationRequestObject()
{
Expand All @@ -326,7 +458,7 @@ public void GetRegistrationRequestObject()
DomainName = "domain_nameea17a44f",
CreateTime = new wkt::Timestamp(),
ExpireTime = new wkt::Timestamp(),
State = Registration.Types.State.Unspecified,
State = Registration.Types.State.Suspended,
Issues =
{
Registration.Types.Issue.UnverifiedEmail,
Expand Down Expand Up @@ -369,7 +501,7 @@ public void GetRegistrationRequestObject()
DomainName = "domain_nameea17a44f",
CreateTime = new wkt::Timestamp(),
ExpireTime = new wkt::Timestamp(),
State = Registration.Types.State.Unspecified,
State = Registration.Types.State.Suspended,
Issues =
{
Registration.Types.Issue.UnverifiedEmail,
Expand Down Expand Up @@ -414,7 +546,7 @@ public void GetRegistration()
DomainName = "domain_nameea17a44f",
CreateTime = new wkt::Timestamp(),
ExpireTime = new wkt::Timestamp(),
State = Registration.Types.State.Unspecified,
State = Registration.Types.State.Suspended,
Issues =
{
Registration.Types.Issue.UnverifiedEmail,
Expand Down Expand Up @@ -457,7 +589,7 @@ public void GetRegistration()
DomainName = "domain_nameea17a44f",
CreateTime = new wkt::Timestamp(),
ExpireTime = new wkt::Timestamp(),
State = Registration.Types.State.Unspecified,
State = Registration.Types.State.Suspended,
Issues =
{
Registration.Types.Issue.UnverifiedEmail,
Expand Down Expand Up @@ -502,7 +634,7 @@ public void GetRegistrationResourceNames()
DomainName = "domain_nameea17a44f",
CreateTime = new wkt::Timestamp(),
ExpireTime = new wkt::Timestamp(),
State = Registration.Types.State.Unspecified,
State = Registration.Types.State.Suspended,
Issues =
{
Registration.Types.Issue.UnverifiedEmail,
Expand Down Expand Up @@ -545,7 +677,7 @@ public void GetRegistrationResourceNames()
DomainName = "domain_nameea17a44f",
CreateTime = new wkt::Timestamp(),
ExpireTime = new wkt::Timestamp(),
State = Registration.Types.State.Unspecified,
State = Registration.Types.State.Suspended,
Issues =
{
Registration.Types.Issue.UnverifiedEmail,
Expand Down
Loading

0 comments on commit c35bada

Please sign in to comment.