public async stt::Task UpdateWorkloadRequestObjectAsync()
        {
            moq::Mock <AssuredWorkloadsService.AssuredWorkloadsServiceClient> mockGrpcClient = new moq::Mock <AssuredWorkloadsService.AssuredWorkloadsServiceClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            UpdateWorkloadRequest request = new UpdateWorkloadRequest
            {
                Workload   = new Workload(),
                UpdateMask = new wkt::FieldMask(),
            };
            Workload expectedResponse = new Workload
            {
                WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"),
                DisplayName  = "display_name137f65c2",
                Resources    =
                {
                    new Workload.Types.ResourceInfo(),
                },
                ComplianceRegime = Workload.Types.ComplianceRegime.FedrampHigh,
                CreateTime       = new wkt::Timestamp(),
                BillingAccount   = "billing_account2062abb6",
#pragma warning disable CS0612
                Il4Settings  = new Workload.Types.IL4Settings(),
                CjisSettings = new Workload.Types.CJISSettings(),
#pragma warning restore CS0612
                Etag   = "etage8ad7218",
                Labels =
                {
                    {
                        "key8a0b6e3c",
                        "value60c16320"
                    },
                },
#pragma warning disable CS0612
                FedrampHighSettings     = new Workload.Types.FedrampHighSettings(),
                FedrampModerateSettings = new Workload.Types.FedrampModerateSettings(),
#pragma warning restore CS0612
                ProvisionedResourcesParent = "provisioned_resources_parent4d000dc9",
                KmsSettings      = new Workload.Types.KMSSettings(),
                ResourceSettings =
                {
                    new Workload.Types.ResourceSettings(),
                },
                KajEnrollmentState      = Workload.Types.KajEnrollmentState.Unspecified,
                EnableSovereignControls = true,
                SaaEnrollmentResponse   = new Workload.Types.SaaEnrollmentResponse(),
            };

            mockGrpcClient.Setup(x => x.UpdateWorkloadAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <Workload>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            AssuredWorkloadsServiceClient client = new AssuredWorkloadsServiceClientImpl(mockGrpcClient.Object, null);
            Workload responseCallSettings        = await client.UpdateWorkloadAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            Workload responseCancellationToken = await client.UpdateWorkloadAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
 /// <summary>Snippet for GetWorkload</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetWorkloadResourceNames()
 {
     // Create client
     AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.Create();
     // Initialize request argument(s)
     WorkloadName name = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]");
     // Make the request
     Workload response = assuredWorkloadsServiceClient.GetWorkload(name);
 }
        /// <summary>Snippet for DeleteWorkloadAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task DeleteWorkloadResourceNamesAsync()
        {
            // Create client
            AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = await AssuredWorkloadsServiceClient.CreateAsync();

            // Initialize request argument(s)
            WorkloadName name = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]");
            // Make the request
            await assuredWorkloadsServiceClient.DeleteWorkloadAsync(name);
        }
Exemplo n.º 4
0
        /// <summary>Snippet for DeleteWorkload</summary>
        public void DeleteWorkloadResourceNames()
        {
            // Snippet: DeleteWorkload(WorkloadName, CallSettings)
            // Create client
            AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.Create();
            // Initialize request argument(s)
            WorkloadName name = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]");

            // Make the request
            assuredWorkloadsServiceClient.DeleteWorkload(name);
            // End snippet
        }
Exemplo n.º 5
0
 /// <summary>Snippet for GetWorkload</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetWorkloadRequestObject()
 {
     // Create client
     AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.Create();
     // Initialize request argument(s)
     GetWorkloadRequest request = new GetWorkloadRequest
     {
         WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"),
     };
     // Make the request
     Workload response = assuredWorkloadsServiceClient.GetWorkload(request);
 }
        public void UpdateWorkloadRequestObject()
        {
            moq::Mock <AssuredWorkloadsService.AssuredWorkloadsServiceClient> mockGrpcClient = new moq::Mock <AssuredWorkloadsService.AssuredWorkloadsServiceClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            UpdateWorkloadRequest request = new UpdateWorkloadRequest
            {
                Workload   = new Workload(),
                UpdateMask = new wkt::FieldMask(),
            };
            Workload expectedResponse = new Workload
            {
                WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"),
                DisplayName  = "display_name137f65c2",
                Resources    =
                {
                    new Workload.Types.ResourceInfo(),
                },
                ComplianceRegime = Workload.Types.ComplianceRegime.UsRegionalAccess,
                CreateTime       = new wkt::Timestamp(),
                BillingAccount   = "billing_account2062abb6",
#pragma warning disable CS0612
                Il4Settings  = new Workload.Types.IL4Settings(),
                CjisSettings = new Workload.Types.CJISSettings(),
#pragma warning restore CS0612
                Etag   = "etage8ad7218",
                Labels =
                {
                    {
                        "key8a0b6e3c",
                        "value60c16320"
                    },
                },
#pragma warning disable CS0612
                FedrampHighSettings     = new Workload.Types.FedrampHighSettings(),
                FedrampModerateSettings = new Workload.Types.FedrampModerateSettings(),
#pragma warning restore CS0612
                ProvisionedResourcesParent = "provisioned_resources_parent4d000dc9",
                KmsSettings      = new Workload.Types.KMSSettings(),
                ResourceSettings =
                {
                    new Workload.Types.ResourceSettings(),
                },
            };

            mockGrpcClient.Setup(x => x.UpdateWorkload(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            AssuredWorkloadsServiceClient client = new AssuredWorkloadsServiceClientImpl(mockGrpcClient.Object, null);
            Workload response = client.UpdateWorkload(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Exemplo n.º 7
0
        /// <summary>Snippet for GetWorkloadAsync</summary>
        public async Task GetWorkloadResourceNamesAsync()
        {
            // Snippet: GetWorkloadAsync(WorkloadName, CallSettings)
            // Additional: GetWorkloadAsync(WorkloadName, CancellationToken)
            // Create client
            AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = await AssuredWorkloadsServiceClient.CreateAsync();

            // Initialize request argument(s)
            WorkloadName name = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]");
            // Make the request
            Workload response = await assuredWorkloadsServiceClient.GetWorkloadAsync(name);

            // End snippet
        }
Exemplo n.º 8
0
        /// <summary>Snippet for DeleteWorkloadAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task DeleteWorkloadRequestObjectAsync()
        {
            // Create client
            AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = await AssuredWorkloadsServiceClient.CreateAsync();

            // Initialize request argument(s)
            DeleteWorkloadRequest request = new DeleteWorkloadRequest
            {
                WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"),
                Etag         = "",
            };
            // Make the request
            await assuredWorkloadsServiceClient.DeleteWorkloadAsync(request);
        }
Exemplo n.º 9
0
        /// <summary>Snippet for DeleteWorkload</summary>
        public void DeleteWorkloadRequestObject()
        {
            // Snippet: DeleteWorkload(DeleteWorkloadRequest, CallSettings)
            // Create client
            AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.Create();
            // Initialize request argument(s)
            DeleteWorkloadRequest request = new DeleteWorkloadRequest
            {
                WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"),
                Etag         = "",
            };

            // Make the request
            assuredWorkloadsServiceClient.DeleteWorkload(request);
            // End snippet
        }
Exemplo n.º 10
0
        public void UpdateWorkload()
        {
            moq::Mock <AssuredWorkloadsService.AssuredWorkloadsServiceClient> mockGrpcClient = new moq::Mock <AssuredWorkloadsService.AssuredWorkloadsServiceClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            UpdateWorkloadRequest request = new UpdateWorkloadRequest
            {
                Workload   = new Workload(),
                UpdateMask = new wkt::FieldMask(),
            };
            Workload expectedResponse = new Workload
            {
                WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"),
                DisplayName  = "display_name137f65c2",
                Resources    =
                {
                    new Workload.Types.ResourceInfo(),
                },
                ComplianceRegime = Workload.Types.ComplianceRegime.FedrampHigh,
                CreateTime       = new wkt::Timestamp(),
                BillingAccount   = "billing_account2062abb6",
                Etag             = "etage8ad7218",
                Labels           =
                {
                    {
                        "key8a0b6e3c",
                        "value60c16320"
                    },
                },
                ProvisionedResourcesParent = "provisioned_resources_parent4d000dc9",
                KmsSettings      = new Workload.Types.KMSSettings(),
                ResourceSettings =
                {
                    new Workload.Types.ResourceSettings(),
                },
                KajEnrollmentState      = Workload.Types.KajEnrollmentState.Unspecified,
                EnableSovereignControls = true,
                SaaEnrollmentResponse   = new Workload.Types.SaaEnrollmentResponse(),
            };

            mockGrpcClient.Setup(x => x.UpdateWorkload(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            AssuredWorkloadsServiceClient client = new AssuredWorkloadsServiceClientImpl(mockGrpcClient.Object, null);
            Workload response = client.UpdateWorkload(request.Workload, request.UpdateMask);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Exemplo n.º 11
0
        public async stt::Task GetWorkloadResourceNamesAsync()
        {
            moq::Mock <AssuredWorkloadsService.AssuredWorkloadsServiceClient> mockGrpcClient = new moq::Mock <AssuredWorkloadsService.AssuredWorkloadsServiceClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            GetWorkloadRequest request = new GetWorkloadRequest
            {
                WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"),
            };
            Workload expectedResponse = new Workload
            {
                WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"),
                DisplayName  = "display_name137f65c2",
                Resources    =
                {
                    new Workload.Types.ResourceInfo(),
                },
                ComplianceRegime = Workload.Types.ComplianceRegime.FedrampHigh,
                CreateTime       = new wkt::Timestamp(),
                BillingAccount   = "billing_account2062abb6",
                Etag             = "etage8ad7218",
                Labels           =
                {
                    {
                        "key8a0b6e3c",
                        "value60c16320"
                    },
                },
                ProvisionedResourcesParent = "provisioned_resources_parent4d000dc9",
                KmsSettings      = new Workload.Types.KMSSettings(),
                ResourceSettings =
                {
                    new Workload.Types.ResourceSettings(),
                },
            };

            mockGrpcClient.Setup(x => x.GetWorkloadAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <Workload>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            AssuredWorkloadsServiceClient client = new AssuredWorkloadsServiceClientImpl(mockGrpcClient.Object, null);
            Workload responseCallSettings        = await client.GetWorkloadAsync(request.WorkloadName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            Workload responseCancellationToken = await client.GetWorkloadAsync(request.WorkloadName, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
Exemplo n.º 12
0
        /// <summary>Snippet for DeleteWorkloadAsync</summary>
        public async Task DeleteWorkloadRequestObjectAsync()
        {
            // Snippet: DeleteWorkloadAsync(DeleteWorkloadRequest, CallSettings)
            // Additional: DeleteWorkloadAsync(DeleteWorkloadRequest, CancellationToken)
            // Create client
            AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = await AssuredWorkloadsServiceClient.CreateAsync();

            // Initialize request argument(s)
            DeleteWorkloadRequest request = new DeleteWorkloadRequest
            {
                WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"),
                Etag         = "",
            };
            // Make the request
            await assuredWorkloadsServiceClient.DeleteWorkloadAsync(request);

            // End snippet
        }
        public void DeleteWorkloadResourceNames()
        {
            moq::Mock <AssuredWorkloadsService.AssuredWorkloadsServiceClient> mockGrpcClient = new moq::Mock <AssuredWorkloadsService.AssuredWorkloadsServiceClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            DeleteWorkloadRequest request = new DeleteWorkloadRequest
            {
                WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"),
            };
            wkt::Empty expectedResponse = new wkt::Empty {
            };

            mockGrpcClient.Setup(x => x.DeleteWorkload(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            AssuredWorkloadsServiceClient client = new AssuredWorkloadsServiceClientImpl(mockGrpcClient.Object, null);

            client.DeleteWorkload(request.WorkloadName);
            mockGrpcClient.VerifyAll();
        }
        public async stt::Task DeleteWorkloadResourceNamesAsync()
        {
            moq::Mock <AssuredWorkloadsService.AssuredWorkloadsServiceClient> mockGrpcClient = new moq::Mock <AssuredWorkloadsService.AssuredWorkloadsServiceClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            DeleteWorkloadRequest request = new DeleteWorkloadRequest
            {
                WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"),
            };
            wkt::Empty expectedResponse = new wkt::Empty {
            };

            mockGrpcClient.Setup(x => x.DeleteWorkloadAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <wkt::Empty>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            AssuredWorkloadsServiceClient client = new AssuredWorkloadsServiceClientImpl(mockGrpcClient.Object, null);
            await client.DeleteWorkloadAsync(request.WorkloadName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            await client.DeleteWorkloadAsync(request.WorkloadName, st::CancellationToken.None);

            mockGrpcClient.VerifyAll();
        }
        public void GetWorkloadResourceNames()
        {
            moq::Mock <AssuredWorkloadsService.AssuredWorkloadsServiceClient> mockGrpcClient = new moq::Mock <AssuredWorkloadsService.AssuredWorkloadsServiceClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            GetWorkloadRequest request = new GetWorkloadRequest
            {
                WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"),
            };
            Workload expectedResponse = new Workload
            {
                WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"),
                DisplayName  = "display_name137f65c2",
                Resources    =
                {
                    new Workload.Types.ResourceInfo(),
                },
                ComplianceRegime = Workload.Types.ComplianceRegime.FedrampHigh,
                CreateTime       = new wkt::Timestamp(),
                BillingAccount   = "billing_account2062abb6",
                Il4Settings      = new Workload.Types.IL4Settings(),
                CjisSettings     = new Workload.Types.CJISSettings(),
                Etag             = "etage8ad7218",
                Labels           =
                {
                    {
                        "key8a0b6e3c",
                        "value60c16320"
                    },
                },
                FedrampHighSettings     = new Workload.Types.FedrampHighSettings(),
                FedrampModerateSettings = new Workload.Types.FedrampModerateSettings(),
            };

            mockGrpcClient.Setup(x => x.GetWorkload(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            AssuredWorkloadsServiceClient client = new AssuredWorkloadsServiceClientImpl(mockGrpcClient.Object, null);
            Workload response = client.GetWorkload(request.WorkloadName);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }