// Token: 0x06001A94 RID: 6804 RVA: 0x000634DC File Offset: 0x000616DC
        protected override Alert[] InternalExecute()
        {
            string text            = HttpContext.Current.Request.Headers["RPSOrgIdPUID"];
            string userPuid        = string.IsNullOrEmpty(text) ? HttpContext.Current.Request.Headers["RPSPUID"] : text;
            string principalName   = ((LiveIDIdentity)Thread.CurrentPrincipal.Identity).PrincipalName;
            string shellServiceUrl = string.Empty;
            string trackingGuid    = Guid.NewGuid().ToString();

            Alert[] alerts;
            try
            {
                using (ShellServiceClient shellServiceClient = new ShellServiceClient("MsOnlineShellService_EndPointConfiguration"))
                {
                    string certificateThumbprint = ConfigurationManager.AppSettings["MsOnlineShellService_CertThumbprint"];
                    shellServiceClient.ClientCredentials.ClientCertificate.Certificate = TlsCertificateInfo.FindCertByThumbprint(certificateThumbprint);
                    shellServiceUrl = shellServiceClient.Endpoint.Address.Uri.AbsoluteUri;
                    GetAlertRequest getAlertRequest = new GetAlertRequest
                    {
                        WorkloadId        = WorkloadAuthenticationId.Exchange,
                        UserPuid          = userPuid,
                        UserPrincipalName = principalName,
                        TrackingGuid      = trackingGuid,
                        CultureName       = Thread.CurrentThread.CurrentUICulture.Name
                    };
                    alerts = shellServiceClient.GetAlerts(getAlertRequest);
                }
            }
            catch (Exception)
            {
                this.LogExceptionFromO365ShellService(principalName, userPuid, shellServiceUrl, trackingGuid);
                throw;
            }
            return(alerts);
        }
Exemplo n.º 2
0
        public async stt::Task GetAlertRequestObjectAsync()
        {
            moq::Mock <AlertCenterService.AlertCenterServiceClient> mockGrpcClient = new moq::Mock <AlertCenterService.AlertCenterServiceClient>(moq::MockBehavior.Strict);
            GetAlertRequest request = new GetAlertRequest
            {
                CustomerId = "customer_id3b3724cb",
                AlertId    = "alert_idc6c58cd5",
            };
            Alert expectedResponse = new Alert
            {
                CustomerId = "customer_id3b3724cb",
                AlertId    = "alert_idc6c58cd5",
                CreateTime = new wkt::Timestamp(),
                StartTime  = new wkt::Timestamp(),
                EndTime    = new wkt::Timestamp(),
                Type       = "typee2cc9d59",
                Source     = "sourcef438cd36",
                Data       = new wkt::Any(),
                SecurityInvestigationToolLink = "security_investigation_tool_linked92158f",
                Deleted    = true,
                Metadata   = new AlertMetadata(),
                UpdateTime = new wkt::Timestamp(),
                Etag       = "etage8ad7218",
            };

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

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

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
Exemplo n.º 3
0
        public void GetAlertRequestObject()
        {
            moq::Mock <AlertCenterService.AlertCenterServiceClient> mockGrpcClient = new moq::Mock <AlertCenterService.AlertCenterServiceClient>(moq::MockBehavior.Strict);
            GetAlertRequest request = new GetAlertRequest
            {
                CustomerId = "customer_id3b3724cb",
                AlertId    = "alert_idc6c58cd5",
            };
            Alert expectedResponse = new Alert
            {
                CustomerId = "customer_id3b3724cb",
                AlertId    = "alert_idc6c58cd5",
                CreateTime = new wkt::Timestamp(),
                StartTime  = new wkt::Timestamp(),
                EndTime    = new wkt::Timestamp(),
                Type       = "typee2cc9d59",
                Source     = "sourcef438cd36",
                Data       = new wkt::Any(),
                SecurityInvestigationToolLink = "security_investigation_tool_linked92158f",
                Deleted    = true,
                Metadata   = new AlertMetadata(),
                UpdateTime = new wkt::Timestamp(),
                Etag       = "etage8ad7218",
            };

            mockGrpcClient.Setup(x => x.GetAlert(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            AlertCenterServiceClient client = new AlertCenterServiceClientImpl(mockGrpcClient.Object, null);
            Alert response = client.GetAlert(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Exemplo n.º 4
0
 /// <summary>Snippet for GetAlert</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetAlertRequestObject()
 {
     // Create client
     AlertCenterServiceClient alertCenterServiceClient = AlertCenterServiceClient.Create();
     // Initialize request argument(s)
     GetAlertRequest request = new GetAlertRequest
     {
         CustomerId = "",
         AlertId    = "",
     };
     // Make the request
     Alert response = alertCenterServiceClient.GetAlert(request);
 }
Exemplo n.º 5
0
        /// <summary>Snippet for GetAlertAsync</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 GetAlertRequestObjectAsync()
        {
            // Create client
            AlertCenterServiceClient alertCenterServiceClient = await AlertCenterServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetAlertRequest request = new GetAlertRequest
            {
                CustomerId = "",
                AlertId    = "",
            };
            // Make the request
            Alert response = await alertCenterServiceClient.GetAlertAsync(request);
        }
        /// <summary>Snippet for GetAlertAsync</summary>
        public async Task GetAlertRequestObjectAsync()
        {
            // Snippet: GetAlertAsync(GetAlertRequest, CallSettings)
            // Additional: GetAlertAsync(GetAlertRequest, CancellationToken)
            // Create client
            AlertCenterServiceClient alertCenterServiceClient = await AlertCenterServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetAlertRequest request = new GetAlertRequest
            {
                CustomerId = "",
                AlertId    = "",
            };
            // Make the request
            Alert response = await alertCenterServiceClient.GetAlertAsync(request);

            // End snippet
        }
        private void HandleOutput(GetAlertRequest request)
        {
            var waiterConfig = new WaiterConfiguration
            {
                MaxAttempts           = MaxWaitAttempts,
                GetNextDelayInSeconds = (_) => WaitIntervalSeconds
            };

            switch (ParameterSetName)
            {
            case LifecycleStateParamSet:
                response = client.Waiters.ForAlert(request, waiterConfig, WaitForLifecycleState).Execute();
                break;

            case Default:
                response = client.GetAlert(request).GetAwaiter().GetResult();
                break;
            }
            WriteOutput(response, response.Alert);
        }
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            GetAlertRequest request;

            try
            {
                request = new GetAlertRequest
                {
                    AlertId      = AlertId,
                    OpcRequestId = OpcRequestId
                };

                HandleOutput(request);
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }
Exemplo n.º 9
0
 // Token: 0x0600051E RID: 1310 RVA: 0x0000E9CA File Offset: 0x0000CBCA
 public IAsyncResult BeginGetAlerts(GetAlertRequest getAlertRequest, AsyncCallback callback, object asyncState)
 {
     return(base.Channel.BeginGetAlerts(getAlertRequest, callback, asyncState));
 }
Exemplo n.º 10
0
 // Token: 0x0600051D RID: 1309 RVA: 0x0000E9BC File Offset: 0x0000CBBC
 public Alert[] GetAlerts(GetAlertRequest getAlertRequest)
 {
     return(base.Channel.GetAlerts(getAlertRequest));
 }