Exemplo n.º 1
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonFraudDetectorConfig config = new AmazonFraudDetectorConfig();

            config.RegionEndpoint = region;
            ConfigureClient(config);
            AmazonFraudDetectorClient client = new AmazonFraudDetectorClient(creds, config);

            GetVariablesResponse resp = new GetVariablesResponse();

            do
            {
                GetVariablesRequest req = new GetVariablesRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxResults = maxItems
                };

                resp = client.GetVariables(req);
                CheckError(resp.HttpStatusCode, "200");

                foreach (var obj in resp.Variables)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Exemplo n.º 2
0
        public override Task <GetVariablesResponse> GetVariables(GetVariablesRequest request,
                                                                 ServerCallContext context)
        {
            RemoteFrame        frame     = frameStore.GetObject(request.Frame.Id);
            List <RemoteValue> variables =
                frame.GetVariables(
                    request.Arguments, request.Locals, request.Statics, request.OnlyInScope);

            var response = new GetVariablesResponse();

            response.Variables.Add(
                variables.Select(s => GrpcFactoryUtils.CreateValue(
                                     s, valueStore.AddObject(s))).ToList());

            return(Task.FromResult(response));
        }
Exemplo n.º 3
0
        public List <RemoteValue> GetVariables(bool arguments, bool locals, bool statics,
                                               bool onlyInScope)
        {
            var request = new GetVariablesRequest
            {
                Frame       = grpcSbFrame,
                Arguments   = arguments,
                Locals      = locals,
                Statics     = statics,
                OnlyInScope = onlyInScope
            };
            GetVariablesResponse response = null;

            if (connection.InvokeRpc(() =>
            {
                response = client.GetVariables(request);
            }))
            {
                return(response.Variables.Select(s => valueFactory.Create(connection, s)).ToList());
            }
            return(new List <RemoteValue>());
        }