Example #1
0
        /// <inheritdoc cref="IKsqlDbDescribeService.DescribeAsObservable" />
        public IObservable <DescribeResponse> DescribeAsObservable(DescribeRequest request)
        {
            Guard.Against.Null(request, nameof(request));

            return(Observable
                   .FromAsync(ct => this.DescribeAsync(request, ct))
                   .SelectMany(responses => responses));
        }
Example #2
0
        /// <inheritdoc cref="IKsqlDbDescribeService.DescribeAsync" />
        public async Task <IEnumerable <DescribeResponse> > DescribeAsync(DescribeRequest request,
                                                                          CancellationToken token = default)
        {
            Guard.Against.Null(request, nameof(request));

            var response = await this.PostAsync <IEnumerable <DescribeResponse>, DescribeRequest>(request, token);

            return(response ?? Enumerable.Empty <DescribeResponse>());
        }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:FuelSDK.InfoReturn"/> class.
        /// </summary>
        /// <param name="objs">Objects.</param>
        public InfoReturn(APIObject objs)
        {
            if (objs == null)
            {
                throw new ArgumentNullException("objs");
            }

            var response = ExecuteAPI(x => new ObjectDefinitionRequest
            {
                ObjectType = TranslateObject(x).GetType().ToString().Replace("FuelSDK.", string.Empty)
            }, (client, o) =>
            {
                var describeRequest  = new DescribeRequest(o);
                var describeResponse = client.SoapClient.DescribeAsync(describeRequest);

                return(new ExecuteAPIResponse <ObjectDefinition>(describeResponse.Result.ObjectDefinition, describeResponse.Result.RequestID, "OK"));
            }, objs);

            if (response != null)
            {
                if (response.Length > 0)
                {
                    if (objs.GetType().ToString().Contains("ET_"))
                    {
                        Results = response[0].Properties.Select(x => (ETPropertyDefinition)(TranslateObject2(x))).ToArray();
                    }
                    else
                    {
                        Results = response[0].Properties.Select(x => (ETPropertyDefinition)(TranslateObject(x))).ToArray();
                    }
                }
                else
                {
                    Status = false;
                }
            }
        }
Example #4
0
 /// <inheritdoc cref="IKsqlDbDescribeService.DescribeAsync" />
 public Task <IEnumerable <DescribeResponse> > DescribeAsync(DescribeRequest request,
                                                             CancellationToken token = default) =>
 this.describeService.DescribeAsync(request, token);