public async Task UpdateGroupAsync_RequestObject()
        {
            // Snippet: UpdateGroupAsync(UpdateGroupRequest,CallSettings)
            // Create client
            ErrorGroupServiceClient errorGroupServiceClient = await ErrorGroupServiceClient.CreateAsync();

            // Initialize request argument(s)
            UpdateGroupRequest request = new UpdateGroupRequest
            {
                Group = new ErrorGroup(),
            };
            // Make the request
            ErrorGroup response = await errorGroupServiceClient.UpdateGroupAsync(request);

            // End snippet
        }
        public async Task GetGroupAsync_RequestObject()
        {
            // Snippet: GetGroupAsync(GetGroupRequest,CallSettings)
            // Create client
            ErrorGroupServiceClient errorGroupServiceClient = await ErrorGroupServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetGroupRequest request = new GetGroupRequest
            {
                GroupNameAsGroupName = new GroupName("[PROJECT]", "[GROUP]"),
            };
            // Make the request
            ErrorGroup response = await errorGroupServiceClient.GetGroupAsync(request);

            // End snippet
        }
        /// <summary>Snippet for GetGroupAsync</summary>
        public async Task GetGroupRequestObjectAsync()
        {
            // Snippet: GetGroupAsync(GetGroupRequest, CallSettings)
            // Additional: GetGroupAsync(GetGroupRequest, CancellationToken)
            // Create client
            ErrorGroupServiceClient errorGroupServiceClient = await ErrorGroupServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetGroupRequest request = new GetGroupRequest
            {
                GroupNameAsErrorGroupName = ErrorGroupName.FromProjectGroup("[PROJECT]", "[GROUP]"),
            };
            // Make the request
            ErrorGroup response = await errorGroupServiceClient.GetGroupAsync(request);

            // End snippet
        }
Exemple #4
0
        public void GetGroup2()
        {
            Mock <ErrorGroupService.ErrorGroupServiceClient> mockGrpcClient = new Mock <ErrorGroupService.ErrorGroupServiceClient>(MockBehavior.Strict);
            GetGroupRequest request = new GetGroupRequest
            {
                GroupNameAsGroupName = new GroupName("[PROJECT]", "[GROUP]"),
            };
            ErrorGroup expectedResponse = new ErrorGroup
            {
                GroupName = new GroupName("[PROJECT]", "[GROUP]"),
                GroupId   = "groupId506361563",
            };

            mockGrpcClient.Setup(x => x.GetGroup(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            ErrorGroupServiceClient client = new ErrorGroupServiceClientImpl(mockGrpcClient.Object, null);
            ErrorGroup response            = client.GetGroup(request);

            Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Exemple #5
0
        public async Task UpdateGroupAsync2()
        {
            Mock <ErrorGroupService.ErrorGroupServiceClient> mockGrpcClient = new Mock <ErrorGroupService.ErrorGroupServiceClient>(MockBehavior.Strict);
            UpdateGroupRequest request = new UpdateGroupRequest
            {
                Group = new ErrorGroup(),
            };
            ErrorGroup expectedResponse = new ErrorGroup
            {
                GroupName = new GroupName("[PROJECT]", "[GROUP]"),
                GroupId   = "groupId506361563",
            };

            mockGrpcClient.Setup(x => x.UpdateGroupAsync(request, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <ErrorGroup>(Task.FromResult(expectedResponse), null, null, null, null));
            ErrorGroupServiceClient client = new ErrorGroupServiceClientImpl(mockGrpcClient.Object, null);
            ErrorGroup response            = await client.UpdateGroupAsync(request);

            Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Exemple #6
0
 public void GetGroup()
 {
     moq::Mock<ErrorGroupService.ErrorGroupServiceClient> mockGrpcClient = new moq::Mock<ErrorGroupService.ErrorGroupServiceClient>(moq::MockBehavior.Strict);
     GetGroupRequest request = new GetGroupRequest
     {
         GroupNameAsErrorGroupName = ErrorGroupName.FromProjectGroup("[PROJECT]", "[GROUP]"),
     };
     ErrorGroup expectedResponse = new ErrorGroup
     {
         ErrorGroupName = ErrorGroupName.FromProjectGroup("[PROJECT]", "[GROUP]"),
         GroupId = "group_id4f9a930e",
         TrackingIssues =
         {
             new TrackingIssue(),
         },
         ResolutionStatus = ResolutionStatus.Muted,
     };
     mockGrpcClient.Setup(x => x.GetGroup(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
     ErrorGroupServiceClient client = new ErrorGroupServiceClientImpl(mockGrpcClient.Object, null);
     ErrorGroup response = client.GetGroup(request.GroupName);
     xunit::Assert.Same(expectedResponse, response);
     mockGrpcClient.VerifyAll();
 }
Exemple #7
0
        /// <param name="body">A valid Clouderrorreporting v1beta1 body.</param>
        /// <returns>ErrorGroupResponse</returns>
        public static ErrorGroup Update(ClouderrorreportingService service, string name, ErrorGroup body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (name == null)
                {
                    throw new ArgumentNullException(name);
                }

                // Make the request.
                return(service.Groups.Update(body, name).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Groups.Update failed.", ex);
            }
        }
Exemple #8
0
 /// <summary>
 /// Replace the data for the specified group.
 /// Fails if the group does not exist.
 /// </summary>
 /// <param name="group">
 /// [Required] The group which replaces the resource on the server.
 /// </param>
 /// <param name="callSettings">
 /// If not null, applies overrides to this RPC call.
 /// </param>
 /// <returns>
 /// The RPC response.
 /// </returns>
 public virtual ErrorGroup UpdateGroup(
     ErrorGroup group,
     CallSettings callSettings = null)
 {
     throw new NotImplementedException();
 }
Exemple #9
0
 /// <summary>
 /// Replace the data for the specified group.
 /// Fails if the group does not exist.
 /// </summary>
 /// <param name="group">
 /// [Required] The group which replaces the resource on the server.
 /// </param>
 /// <param name="cancellationToken">
 /// A <see cref="CancellationToken"/> to use for this RPC.
 /// </param>
 /// <returns>
 /// A Task containing the RPC response.
 /// </returns>
 public virtual Task <ErrorGroup> UpdateGroupAsync(
     ErrorGroup group,
     CancellationToken cancellationToken) => UpdateGroupAsync(
     group,
     CallSettings.FromCancellationToken(cancellationToken));
Exemple #10
0
 /// <summary>
 /// Replace the data for the specified group.
 /// Fails if the group does not exist.
 /// </summary>
 /// <param name="group">
 /// [Required] The group which replaces the resource on the server.
 /// </param>
 /// <param name="callSettings">
 /// If not null, applies overrides to this RPC call.
 /// </param>
 /// <returns>
 /// A Task containing the RPC response.
 /// </returns>
 public virtual Task <ErrorGroup> UpdateGroupAsync(
     ErrorGroup group,
     CallSettings callSettings = null)
 {
     throw new NotImplementedException();
 }