Exemplo n.º 1
0
        private HttpMessage CreateListRequest(IEnumerable <string> phenotypes = null, IEnumerable <string> ids = null, IEnumerable <string> names = null, IEnumerable <string> propertyFilters = null, IEnumerable <string> statuses = null, DateTimeOffset?minCreatedDateTime = null, DateTimeOffset?maxCreatedDateTime = null, DateTimeOffset?minLastModifiedDateTime = null, DateTimeOffset?maxLastModifiedDateTime = null, int?maxPageSize = null, string skipToken = null, RequestOptions options = null)
        {
            var message = Pipeline.CreateMessage();
            var request = message.Request;

            request.Method = RequestMethod.Get;
            var uri = new RawRequestUriBuilder();

            uri.Reset(endpoint);
            uri.AppendPath("/crops", false);
            if (phenotypes != null)
            {
                uri.AppendQueryDelimited("phenotypes", phenotypes, ",", true);
            }
            if (ids != null)
            {
                uri.AppendQueryDelimited("ids", ids, ",", true);
            }
            if (names != null)
            {
                uri.AppendQueryDelimited("names", names, ",", true);
            }
            if (propertyFilters != null)
            {
                uri.AppendQueryDelimited("propertyFilters", propertyFilters, ",", true);
            }
            if (statuses != null)
            {
                uri.AppendQueryDelimited("statuses", statuses, ",", true);
            }
            if (minCreatedDateTime != null)
            {
                uri.AppendQuery("minCreatedDateTime", minCreatedDateTime.Value, "O", true);
            }
            if (maxCreatedDateTime != null)
            {
                uri.AppendQuery("maxCreatedDateTime", maxCreatedDateTime.Value, "O", true);
            }
            if (minLastModifiedDateTime != null)
            {
                uri.AppendQuery("minLastModifiedDateTime", minLastModifiedDateTime.Value, "O", true);
            }
            if (maxLastModifiedDateTime != null)
            {
                uri.AppendQuery("maxLastModifiedDateTime", maxLastModifiedDateTime.Value, "O", true);
            }
            if (maxPageSize != null)
            {
                uri.AppendQuery("$maxPageSize", maxPageSize.Value, true);
            }
            if (skipToken != null)
            {
                uri.AppendQuery("$skipToken", skipToken, true);
            }
            uri.AppendQuery("api-version", apiVersion, true);
            request.Uri = uri;
            request.Headers.Add("Accept", "application/json");
            return(message);
        }
Exemplo n.º 2
0
        private HttpMessage CreateListRequest(string provider, string farmerId, string boundaryId, string source = null, DateTimeOffset?startDateTime = null, DateTimeOffset?endDateTime = null, double?maxCloudCoveragePercentage = null, double?maxDarkPixelCoveragePercentage = null, IEnumerable <string> imageNames = null, IEnumerable <double> imageResolutions = null, IEnumerable <string> imageFormats = null, int?maxPageSize = null, string skipToken = null, RequestOptions requestOptions = null)
        {
            var message = Pipeline.CreateMessage();
            var request = message.Request;

            request.Method = RequestMethod.Get;
            var uri = new RawRequestUriBuilder();

            uri.Reset(endpoint);
            uri.AppendPath("/scenes", false);
            uri.AppendQuery("provider", provider, true);
            uri.AppendQuery("farmerId", farmerId, true);
            uri.AppendQuery("boundaryId", boundaryId, true);
            if (source != null)
            {
                uri.AppendQuery("source", source, true);
            }
            if (startDateTime != null)
            {
                uri.AppendQuery("startDateTime", startDateTime.Value, "O", true);
            }
            if (endDateTime != null)
            {
                uri.AppendQuery("endDateTime", endDateTime.Value, "O", true);
            }
            if (maxCloudCoveragePercentage != null)
            {
                uri.AppendQuery("maxCloudCoveragePercentage", maxCloudCoveragePercentage.Value, true);
            }
            if (maxDarkPixelCoveragePercentage != null)
            {
                uri.AppendQuery("maxDarkPixelCoveragePercentage", maxDarkPixelCoveragePercentage.Value, true);
            }
            if (imageNames != null)
            {
                uri.AppendQueryDelimited("imageNames", imageNames, ",", true);
            }
            if (imageResolutions != null)
            {
                uri.AppendQueryDelimited("imageResolutions", imageResolutions, ",", true);
            }
            if (imageFormats != null)
            {
                uri.AppendQueryDelimited("imageFormats", imageFormats, ",", true);
            }
            if (maxPageSize != null)
            {
                uri.AppendQuery("$maxPageSize", maxPageSize.Value, true);
            }
            if (skipToken != null)
            {
                uri.AppendQuery("$skipToken", skipToken, true);
            }
            uri.AppendQuery("api-version", apiVersion, true);
            request.Uri = uri;
            request.Headers.Add("Accept", "application/json");
            return(message);
        }
        private HttpMessage CreateListRequest(IEnumerable <string> authProviderIds = null, IEnumerable <string> farmerIds = null, bool?isValid = null, DateTimeOffset?minCreatedDateTime = null, DateTimeOffset?maxCreatedDateTime = null, DateTimeOffset?minLastModifiedDateTime = null, DateTimeOffset?maxLastModifiedDateTime = null, int?maxPageSize = null, string skipToken = null, RequestOptions options = null)
        {
            var message = Pipeline.CreateMessage();
            var request = message.Request;

            request.Method = RequestMethod.Get;
            var uri = new RawRequestUriBuilder();

            uri.Reset(endpoint);
            uri.AppendPath("/oauth/tokens", false);
            if (authProviderIds != null)
            {
                uri.AppendQueryDelimited("authProviderIds", authProviderIds, ",", true);
            }
            if (farmerIds != null)
            {
                uri.AppendQueryDelimited("farmerIds", farmerIds, ",", true);
            }
            if (isValid != null)
            {
                uri.AppendQuery("isValid", isValid.Value, true);
            }
            if (minCreatedDateTime != null)
            {
                uri.AppendQuery("minCreatedDateTime", minCreatedDateTime.Value, "O", true);
            }
            if (maxCreatedDateTime != null)
            {
                uri.AppendQuery("maxCreatedDateTime", maxCreatedDateTime.Value, "O", true);
            }
            if (minLastModifiedDateTime != null)
            {
                uri.AppendQuery("minLastModifiedDateTime", minLastModifiedDateTime.Value, "O", true);
            }
            if (maxLastModifiedDateTime != null)
            {
                uri.AppendQuery("maxLastModifiedDateTime", maxLastModifiedDateTime.Value, "O", true);
            }
            if (maxPageSize != null)
            {
                uri.AppendQuery("$maxPageSize", maxPageSize.Value, true);
            }
            if (skipToken != null)
            {
                uri.AppendQuery("$skipToken", skipToken, true);
            }
            uri.AppendQuery("api-version", apiVersion, true);
            request.Uri = uri;
            request.Headers.Add("Accept", "application/json");
            return(message);
        }
        internal HttpMessage CreateListRequest(IEnumerable <string> dependenciesFor, bool?includeModelDefinition, GetModelsOptions digitalTwinModelsListOptions)
        {
            var message = _pipeline.CreateMessage();
            var request = message.Request;

            request.Method = RequestMethod.Get;
            var uri = new RawRequestUriBuilder();

            uri.Reset(endpoint);
            uri.AppendPath("/models", false);
            if (dependenciesFor != null)
            {
                uri.AppendQueryDelimited("dependenciesFor", dependenciesFor, ",", true);
            }
            if (includeModelDefinition != null)
            {
                uri.AppendQuery("includeModelDefinition", includeModelDefinition.Value, true);
            }
            uri.AppendQuery("api-version", apiVersion, true);
            request.Uri = uri;
            if (digitalTwinModelsListOptions?.MaxItemCount != null)
            {
                request.Headers.Add("x-ms-max-item-count", digitalTwinModelsListOptions.MaxItemCount.Value);
            }
            return(message);
        }
Exemplo n.º 5
0
        internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string skip, int?count, bool?isDefault, IEnumerable <string> names, string searchText, string orderBy, bool?orderByAsc)
        {
            var message = _pipeline.CreateMessage();
            var request = message.Request;

            request.Method = RequestMethod.Get;
            var uri = new RawRequestUriBuilder();

            uri.Reset(_endpoint);
            uri.AppendPath("/subscriptions/", false);
            uri.AppendPath(subscriptionId, true);
            uri.AppendPath("/resourceGroups/", false);
            uri.AppendPath(resourceGroupName, true);
            uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false);
            uri.AppendPath(workspaceName, true);
            uri.AppendPath("/datastores", false);
            uri.AppendQuery("api-version", _apiVersion, true);
            if (skip != null)
            {
                uri.AppendQuery("$skip", skip, true);
            }
            if (count != null)
            {
                uri.AppendQuery("count", count.Value, true);
            }
            if (isDefault != null)
            {
                uri.AppendQuery("isDefault", isDefault.Value, true);
            }
            if (names != null)
            {
                uri.AppendQueryDelimited("names", names, ",", true);
            }
            if (searchText != null)
            {
                uri.AppendQuery("searchText", searchText, true);
            }
            if (orderBy != null)
            {
                uri.AppendQuery("orderBy", orderBy, true);
            }
            if (orderByAsc != null)
            {
                uri.AppendQuery("orderByAsc", orderByAsc.Value, true);
            }
            request.Uri = uri;
            request.Headers.Add("Accept", "application/json");
            _userAgent.Apply(message);
            return(message);
        }
        internal HttpMessage CreateArrayStringMultiEmptyRequest(IEnumerable <string> arrayQuery)
        {
            var message = _pipeline.CreateMessage();
            var request = message.Request;

            request.Method = RequestMethod.Get;
            var uri = new RawRequestUriBuilder();

            uri.Reset(endpoint);
            uri.AppendPath("/queries/array/multi/string/empty", false);
            if (arrayQuery != null)
            {
                uri.AppendQueryDelimited("arrayQuery", arrayQuery, ",", true);
            }
            request.Uri = uri;
            return(message);
        }
Exemplo n.º 7
0
        internal HttpMessage CreateListSharesSegmentRequest(string prefix, string marker, int?maxresults, IEnumerable <ListSharesIncludeType> include, int?timeout)
        {
            var message = _pipeline.CreateMessage();
            var request = message.Request;

            request.Method = RequestMethod.Get;
            var uri = new RawRequestUriBuilder();

            uri.AppendRaw(url, false);
            uri.AppendPath("/", false);
            uri.AppendQuery("comp", "list", true);
            if (prefix != null)
            {
                uri.AppendQuery("prefix", prefix, true);
            }
            if (marker != null)
            {
                uri.AppendQuery("marker", marker, true);
            }
            if (maxresults != null)
            {
                uri.AppendQuery("maxresults", maxresults.Value, true);
            }
            if (include != null)
            {
                uri.AppendQueryDelimited("include", include, ",", true);
            }
            if (timeout != null)
            {
                uri.AppendQuery("timeout", timeout.Value, true);
            }
            request.Uri = uri;
            request.Headers.Add("x-ms-version", version);
            request.Headers.Add("Accept", "application/xml");
            return(message);
        }
Exemplo n.º 8
0
        internal HttpMessage CreateDeliveryNoteLinesToInvoiceLinesRequest(string version, IEnumerable <long> deliveryNotesListDeliveryNoteId, Enum72?acceptLanguage)
        {
            var message = _pipeline.CreateMessage();
            var request = message.Request;

            request.Method = RequestMethod.Get;
            var uri = new RawRequestUriBuilder();

            uri.Reset(endpoint);
            uri.AppendPath("/api/v", false);
            uri.AppendPath(version, true);
            uri.AppendPath("/accounting/invoices/deliveryNoteLinesToInvoiceLines", false);
            if (deliveryNotesListDeliveryNoteId != null)
            {
                uri.AppendQueryDelimited("deliveryNotesList.deliveryNoteId", deliveryNotesListDeliveryNoteId, ",", true);
            }
            request.Uri = uri;
            if (acceptLanguage != null)
            {
                request.Headers.Add("Accept-Language", acceptLanguage.Value.ToString());
            }
            request.Headers.Add("Accept", "application/json, text/json, application/xml, text/xml");
            return(message);
        }