public async stt::Task GetRequestObjectAsync()
 {
     moq::Mock<PublicAdvertisedPrefixes.PublicAdvertisedPrefixesClient> mockGrpcClient = new moq::Mock<PublicAdvertisedPrefixes.PublicAdvertisedPrefixesClient>(moq::MockBehavior.Strict);
     mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object);
     GetPublicAdvertisedPrefixeRequest request = new GetPublicAdvertisedPrefixeRequest
     {
         PublicAdvertisedPrefix = "public_advertised_prefix53682ff1",
         Project = "projectaa6ff846",
     };
     PublicAdvertisedPrefix expectedResponse = new PublicAdvertisedPrefix
     {
         Id = 11672635353343658936UL,
         Kind = "kindf7aa39d9",
         Name = "name1c9368b0",
         CreationTimestamp = "creation_timestamp235e59a1",
         IpCidrRange = "ip_cidr_range745a04d3",
         Status = "status5444cb9a",
         Fingerprint = "fingerprint009e6052",
         DnsVerificationIp = "dns_verification_ipd7378841",
         SharedSecret = "shared_secret3a48b317",
         Description = "description2cf9da67",
         PublicDelegatedPrefixs =
         {
             new PublicAdvertisedPrefixPublicDelegatedPrefix(),
         },
         SelfLink = "self_link7e87f12d",
     };
     mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<PublicAdvertisedPrefix>(stt::Task.FromResult(expectedResponse), null, null, null, null));
     PublicAdvertisedPrefixesClient client = new PublicAdvertisedPrefixesClientImpl(mockGrpcClient.Object, null);
     PublicAdvertisedPrefix responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));
     xunit::Assert.Same(expectedResponse, responseCallSettings);
     PublicAdvertisedPrefix responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None);
     xunit::Assert.Same(expectedResponse, responseCancellationToken);
     mockGrpcClient.VerifyAll();
 }
Пример #2
0
        public void Get()
        {
            moq::Mock <PublicAdvertisedPrefixes.PublicAdvertisedPrefixesClient> mockGrpcClient = new moq::Mock <PublicAdvertisedPrefixes.PublicAdvertisedPrefixesClient>(moq::MockBehavior.Strict);
            GetPublicAdvertisedPrefixeRequest request = new GetPublicAdvertisedPrefixeRequest
            {
                PublicAdvertisedPrefix = "public_advertised_prefix53682ff1",
                Project = "projectaa6ff846",
            };
            PublicAdvertisedPrefix expectedResponse = new PublicAdvertisedPrefix
            {
                Id   = 11672635353343658936UL,
                Kind = "kindf7aa39d9",
                Name = "name1c9368b0",
                CreationTimestamp      = "creation_timestamp235e59a1",
                IpCidrRange            = "ip_cidr_range745a04d3",
                Status                 = PublicAdvertisedPrefix.Types.Status.PrefixConfigurationComplete,
                Fingerprint            = "fingerprint009e6052",
                DnsVerificationIp      = "dns_verification_ipd7378841",
                SharedSecret           = "shared_secret3a48b317",
                Description            = "description2cf9da67",
                PublicDelegatedPrefixs =
                {
                    new PublicAdvertisedPrefixPublicDelegatedPrefix(),
                },
                SelfLink = "self_link7e87f12d",
            };

            mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            PublicAdvertisedPrefixesClient client   = new PublicAdvertisedPrefixesClientImpl(mockGrpcClient.Object, null);
            PublicAdvertisedPrefix         response = client.Get(request.Project, request.PublicAdvertisedPrefix);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
 /// <summary>Snippet for Get</summary>
 public void GetRequestObject()
 {
     // Snippet: Get(GetPublicAdvertisedPrefixeRequest, CallSettings)
     // Create client
     PublicAdvertisedPrefixesClient publicAdvertisedPrefixesClient = PublicAdvertisedPrefixesClient.Create();
     // Initialize request argument(s)
     GetPublicAdvertisedPrefixeRequest request = new GetPublicAdvertisedPrefixeRequest
     {
         PublicAdvertisedPrefix = "",
         Project = "",
     };
     // Make the request
     PublicAdvertisedPrefix response = publicAdvertisedPrefixesClient.Get(request);
     // End snippet
 }
        /// <summary>Snippet for GetAsync</summary>
        public async Task GetRequestObjectAsync()
        {
            // Snippet: GetAsync(GetPublicAdvertisedPrefixeRequest, CallSettings)
            // Additional: GetAsync(GetPublicAdvertisedPrefixeRequest, CancellationToken)
            // Create client
            PublicAdvertisedPrefixesClient publicAdvertisedPrefixesClient = await PublicAdvertisedPrefixesClient.CreateAsync();

            // Initialize request argument(s)
            GetPublicAdvertisedPrefixeRequest request = new GetPublicAdvertisedPrefixeRequest
            {
                PublicAdvertisedPrefix = "",
                Project = "",
            };
            // Make the request
            PublicAdvertisedPrefix response = await publicAdvertisedPrefixesClient.GetAsync(request);

            // End snippet
        }
Пример #5
0
 /// <summary>
 /// Returns the specified PublicAdvertisedPrefix resource.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public override stt::Task <PublicAdvertisedPrefix> GetAsync(GetPublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_GetPublicAdvertisedPrefixeRequest(ref request, ref callSettings);
     return(_callGet.Async(request, callSettings));
 }
Пример #6
0
 /// <summary>
 /// Returns the specified PublicAdvertisedPrefix resource.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>The RPC response.</returns>
 public override PublicAdvertisedPrefix Get(GetPublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_GetPublicAdvertisedPrefixeRequest(ref request, ref callSettings);
     return(_callGet.Sync(request, callSettings));
 }
Пример #7
0
 partial void Modify_GetPublicAdvertisedPrefixeRequest(ref GetPublicAdvertisedPrefixeRequest request, ref gaxgrpc::CallSettings settings);
Пример #8
0
 /// <summary>
 /// Returns the specified PublicAdvertisedPrefix resource.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="cancellationToken">A <see cref="st::CancellationToken"/> to use for this RPC.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public virtual stt::Task <PublicAdvertisedPrefix> GetAsync(GetPublicAdvertisedPrefixeRequest request, st::CancellationToken cancellationToken) =>
 GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
Пример #9
0
 /// <summary>
 /// Returns the specified PublicAdvertisedPrefix resource.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public virtual stt::Task <PublicAdvertisedPrefix> GetAsync(GetPublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) =>
 throw new sys::NotImplementedException();