diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index eecc8a57b2dc..edd775b7415d 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -206,7 +206,6 @@ com.azure:azure-storage-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-storage-queue;12.28.1;12.29.0-beta.1 com.azure:azure-template-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-template-stress;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-verticals-agrifood-farming;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-xml;1.2.1;1.3.0-beta.1 com.azure:perf-test-core;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-ai-vision-imageanalysis;1.0.7;1.1.0-beta.1 diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/README.md b/sdk/agrifood/azure-resourcemanager-agrifood/README.md index 6c4e7d7301da..d92368c2b4dd 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/README.md +++ b/sdk/agrifood/azure-resourcemanager-agrifood/README.md @@ -1,5 +1,7 @@ # Azure Resource Manager AgriFood client library for Java +Please note, this package has been deprecated and will no longer be maintained after September 1, 2025. The underlying Azure Data Manager for Agriculture service will be retired on September 1, 2025. We recommend that you pause new development and begin transition planning as soon as possible. Refer to our [deprecation policy](https://aka.ms/azsdk/support-policies) for more details. + Azure Resource Manager AgriFood client library for Java. This package contains Microsoft Azure SDK for AgriFood Management SDK. APIs documentation for Azure AgFoodPlatform Resource Provider Service. Package tag package-preview-2021-09. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/CHANGELOG.md b/sdk/agrifood/azure-verticals-agrifood-farming/CHANGELOG.md deleted file mode 100644 index 562110881977..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/CHANGELOG.md +++ /dev/null @@ -1,42 +0,0 @@ -# Release History - -## 1.0.0-beta.4 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 1.0.0-beta.3 (2023-02-23) -### Features Added -- Adding clients for Sensor Integration which includes crud operations on DeviceDataModels, Devices, SensorDataModels, Sensors, SensorMappings, SensorPartnerIntegration and get Sensor events. -- Adding new APIs for STAC search and get feature -- Adding breedingMethods and Measurements as part of Crop Entity -- Adding geographicIdentifier as part of Season Entity -- Adding trait, relativeMeasurements and treatments as part of CropVariety Entity -- Adding type, crs, centroid and bbox(bounding box of the geometry) as part of Boundary Entity -- Adding Source field in Farmer, Farm, Field, Seasonal Field, Boundary, Crop, Crop variety, Season and Attachment -- CreatedBy and ModifiedBy in all entities -- Measure renamed to measurements in Prescription & Crop -- Acreage renamed to area in Boundary -- Get Feature and Search Feature APIs for Sentinel 2 L2A and Sentinel 2 L1C STAC collections -- Adding Weather Data APIs to fetch IBM weather data - -### Breaking Changes -- Removing primaryBoundaryId & boundaryIds from Field and Seasonal Field -- Removing isPrimary flag from Boundary -- Removing avgYields from Seasonal Field -- Renaming Farmer to Party -- Renaming CropVariety to CropProduct - -## 1.0.0-beta.2 (2021-05-27) - -- Update README with more service documentation. -- Update body parameter names (https://github.com/Azure/azure-rest-api-specs/pull/14408). - -## 1.0.0-beta.1 (2021-05-11) - -- Initial beta release for FarmBeats client library. diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/README.md b/sdk/agrifood/azure-verticals-agrifood-farming/README.md deleted file mode 100644 index 60d5d1980494..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/README.md +++ /dev/null @@ -1,183 +0,0 @@ -# Azure FarmBeats client library for Java - -FarmBeats is a B2B PaaS offering from Microsoft that makes it easy for AgriFood companies to build intelligent digital agriculture solutions on Azure. FarmBeats allows users to acquire, aggregate, and process agricultural data from various sources (farm equipment, weather, satellite) without the need to invest in deep data engineering resources.  Customers can build SaaS solutions on top of FarmBeats and leverage first class support for model building to generate insights at scale. - -Use FarmBeats client library for Python to do the following. - -- Create & update parties, farms, fields, seasonal fields and boundaries. -- Ingest satellite and weather data for areas of interest. -- Ingest farm operations data covering tilling, planting, harvesting and application of farm inputs. - -[Source code][source_code] | [Package (Maven)][package] | [Product Documentation][product_documentation] | [Samples][samples_readme] - -## Getting started - -### Prerequisites - -- A [Java Development Kit (JDK)][jdk_link], version 8 or later. -- [Azure Subscription][azure_subscription] -- AgriFood (FarmBeats) resource - [Install FarmBeats][install_farmbeats] - -### Include the Package - -[//]: # ({x-version-update-start;com.azure:azure-verticals-agrifood-farming;current}) -```xml - - com.azure - azure-verticals-agrifood-farming - 1.0.0-beta.4 - -``` -[//]: # ({x-version-update-end}) - -### Authenticate the client - -#### Using Azure Active Directory - -In order to interact with the Azure FarmBeats service, your client must present an Azure Active Directory bearer token to the service. - -After setup, you can choose which type of [credential][azure_identity_credential_type] from `azure-identity` to use. -We recommend using [DefaultAzureCredential][identity_dac], configured through the `AZURE_TOKEN_CREDENTIALS` environment variable. -Set this variable as described in the [Learn documentation][customize_defaultAzureCredential], which provides the most up-to-date guidance and examples. - -The simplest way of providing a bearer token is to use the `DefaultAzureCredential` authentication method by providing client secret credentials is being used in this getting started section but you can find more ways to authenticate with [azure-identity][azure_identity]. - -You can authenticate with Azure Active Directory using the [Azure Identity library][azure_identity]. - -To use the [DefaultAzureCredential][DefaultAzureCredential] provider shown below, or other credential providers provided with the Azure SDK, please include the `azure-identity` package: - -[//]: # ({x-version-update-start;com.azure:azure-identity;dependency}) -```xml - - com.azure - azure-identity - 1.18.2 - -``` - -##### Example - Create Parties Client - -```java readme-sample-createPartiesClient -String endpoint = "https://.farmbeats.azure.net"; - -// Create Parties Client -PartiesClientBuilder partiesBuilder = new PartiesClientBuilder() - .endpoint(endpoint) - .credential(new DefaultAzureCredentialBuilder().build()); -PartiesAsyncClient partiesClient = partiesBuilder.buildAsyncClient(); - -``` - -##### Example - Create Boundaries Client -```java readme-sample-createBoundariesClient -// Create Boundaries Client -BoundariesClientBuilder boundariesBuilder = new BoundariesClientBuilder() - .endpoint(endpoint) - .credential(new DefaultAzureCredentialBuilder().build()); -BoundariesAsyncClient boundariesClient = boundariesBuilder.buildAsyncClient(); -``` - -##### Example - Create Scenes Client -```java readme-sample-createScenesClient -// Create Scenes Client -ScenesClientBuilder scenesBuilder = new ScenesClientBuilder() - .endpoint(endpoint) - .credential(new DefaultAzureCredentialBuilder().build()); -ScenesAsyncClient scenesClient = scenesBuilder.buildAsyncClient(); -``` - -## Key concepts - -Basic understanding of below terms will help to get started with FarmBeats client library. - -### [Farm Hierarchy][farm_hierarchy] -Farm hierarchy is a collection of below entities. -- Party - is the custodian of all the agronomic data. -- Farm - is a logical collection of fields and/or seasonal fields. They do not have any area associated with them. -- Field - is a multi-polygon area. This is expected to be stable across seasons. -- Seasonal field - is a multi-polygon area. To define a seasonal boundary we need the details of area (boundary), time (season) and crop. New seasonal fields are expected to be created for every growing season. -- Boundary - is the actual multi-polygon area expressed as a geometry (in geojson). It is normally associated with a field or a seasonal field. Satellite, weather and farm operations data is linked to a boundary. -- Cascade delete - Agronomic data is stored hierarchically with party as the root. The hierarchy includes Party -> Farms -> Fields -> Seasonal Fields -> Boundaries -> Associated data (satellite, weather, farm operations). Cascade delete refers to the process of deleting any node and its subtree. - -#### Example - -```java readme-sample-createFarmHierarchy -// Create Party -Map partyData = new HashMap<>(); -partyData.put("name", "party1"); -BinaryData party = BinaryData.fromObject(partyData); -partiesClient.createOrUpdateWithResponse("contoso-party", party, null).block(); - -// Get Party -Response response = partiesClient.getWithResponse("contoso-party", new RequestOptions()).block(); -System.out.println(response.getValue()); - -// Create Boundary -BinaryData boundary = BinaryData.fromString("{\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[73.70457172393799,20.545385304358106],[73.70457172393799,20.545385304358106],[73.70448589324951,20.542411534243367],[73.70877742767334,20.541688176010233],[73.71023654937744,20.545083911372505],[73.70663166046143,20.546992723579137],[73.70457172393799,20.545385304358106]]]},\"name\":\"string\",\"description\":\"string\"}"); -response = boundariesClient.createOrUpdateWithResponse("contoso-party", "contoso-boundary", boundary, null).block(); -System.out.println(response.getValue()); -``` - -### [Scenes][scenes] -Scenes refers to images normally ingested using satellite APIs. This includes raw bands and derived bands (Ex: NDVI). Scenes may also include spatial outputs of an inference or AI/ML model (Ex: LAI). - -#### Example - -```java readme-sample-ingestSatelliteData -// Trigger Satellite job and wait for completion -BinaryData satelliteJob = BinaryData.fromString("{\"boundaryId\":\"contoso-boundary\",\"endDateTime\":\"2022-02-01T00:00:00Z\",\"partyId\":\"contoso-party\",\"source\":\"Sentinel_2_L2A\",\"startDateTime\":\"2022-01-01T00:00:00Z\",\"provider\":\"Microsoft\",\"data\":{\"imageNames\":[\"NDVI\"],\"imageFormats\":[\"TIF\"],\"imageResolutions\":[10]},\"name\":\"string\",\"description\":\"string\"}"); -scenesClient.beginCreateSatelliteDataIngestionJob("contoso-job-46856", satelliteJob, null).getSyncPoller().waitForCompletion(); -System.out.println(scenesClient.getSatelliteDataIngestionJobDetailsWithResponse("contoso-job-46856", null).block().getValue()); - -// Iterate through ingested scenes -Iterable scenes = scenesClient.list("Microsoft", "contoso-party", "contoso-boundary", "Sentinel_2_L2A", null).toIterable(); -scenes.forEach(scene -> System.out.println(scene)); -``` - -### [Farm Operations][farm_operations_docs] -Fam operations includes details pertaining to tilling, planting, application of pesticides & nutrients, and harvesting. This can either be manually pushed into FarmBeats using APIs or the same information can be pulled from farm equipment service providers like John Deere. - -## Examples -More examples can be found in [samples][samples_code]. - -## Troubleshooting - -### Enabling Logging - -Azure SDKs for Java offer a consistent logging story to help aid in troubleshooting application errors and expedite -their resolution. The logs produced will capture the flow of an application before reaching the terminal state to help -locate the root issue. View the [logging][logging] wiki for guidance about enabling logging. - -## Next steps -For more extensive documentation please check our [Product Documentation][product_documentation]. - -## Contributing - -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). - -This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, view [Microsoft's CLA](https://cla.microsoft.com). - -When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. - - -[samples]: src/samples/java/com/azure/verticals/agrifood/farming -[source_code]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/agrifood/azure-verticals-agrifood-farming/src -[samples_code]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/agrifood/azure-verticals-agrifood-farming/src/samples/ -[azure_subscription]: https://azure.microsoft.com/free/ -[product_documentation]: https://aka.ms/FarmBeatsProductDocumentationPaaS -[azure_portal]: https://portal.azure.com -[jdk_link]: https://learn.microsoft.com/java/azure/jdk/?view=azure-java-stable -[package]: https://central.sonatype.com/artifact/com.azure/azure-verticals-agrifood-farming -[samples_readme]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/agrifood/azure-verticals-agrifood-farming/src/samples/README.md -[farm_hierarchy]: https://aka.ms/FarmBeatsFarmHierarchyDocs -[farm_operations_docs]: https://aka.ms/FarmBeatsFarmOperationsDocumentation -[scenes]: https://aka.ms/FarmBeatsSatellitePaaSDocumentation -[install_farmbeats]: https://aka.ms/FarmBeatsInstallDocumentationPaaS -[coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ -[logging]: https://github.com/Azure/azure-sdk-for-java/wiki/Logging-in-Azure-SDK -[customize_defaultAzureCredential]: https://aka.ms/azsdk/java/identity/credential-chains#how-to-customize-defaultazurecredential -[azure_identity_credential_type]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials -[identity_dac]: https://aka.ms/azsdk/java/identity/credential-chains#defaultazurecredential-overview diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/checkstyle-suppressions.xml b/sdk/agrifood/azure-verticals-agrifood-farming/checkstyle-suppressions.xml deleted file mode 100644 index 4e18c6ea8bca..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/checkstyle-suppressions.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/pom.xml b/sdk/agrifood/azure-verticals-agrifood-farming/pom.xml deleted file mode 100644 index 23ebc19860d3..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/pom.xml +++ /dev/null @@ -1,81 +0,0 @@ - - 4.0.0 - - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - - - com.azure - azure-verticals-agrifood-farming - 1.0.0-beta.4 - - Microsoft Azure client library for FarmBeats - This package contains Microsoft Azure FarmBeats client library. - - - - azure-java-build-docs - ${site.url}/site/${project.artifactId} - - - - - scm:git:https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - - false - 0.000 - 0.000 - - --add-exports com.azure.core/com.azure.core.implementation.jackson=ALL-UNNAMED - - - false - - - - - com.azure - azure-core - 1.57.1 - - - com.azure - azure-core-experimental - 1.0.0-beta.66 - - - com.azure - azure-core-http-netty - 1.16.3 - - - - - com.azure - azure-core-test - 1.27.0-beta.14 - test - - - com.azure - azure-identity - 1.18.2 - test - - - com.azure - azure-core-serializer-json-jackson - 1.6.3 - test - - - diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/spotbugs-exclude.xml b/sdk/agrifood/azure-verticals-agrifood-farming/spotbugs-exclude.xml deleted file mode 100644 index b1c0a0302d65..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/spotbugs-exclude.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ApplicationDataAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ApplicationDataAsyncClient.java deleted file mode 100644 index a227bceb2151..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ApplicationDataAsyncClient.java +++ /dev/null @@ -1,480 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollerFlux; -import com.azure.verticals.agrifood.farming.implementation.ApplicationDatasImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = ApplicationDataClientBuilder.class, isAsync = true) -public final class ApplicationDataAsyncClient { - @Generated - private final ApplicationDatasImpl serviceClient; - - /** - * Initializes an instance of ApplicationDataAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - ApplicationDataAsyncClient(ApplicationDatasImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of application data resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minAvgMaterialDoubleNoMinimum average amount of material applied during the application (inclusive).
maxAvgMaterialDoubleNoMaximum average amount of material applied during the application (inclusive).
minTotalMaterialDoubleNoMinimum total amount of material applied during the application (inclusive).
maxTotalMaterialDoubleNoMaximum total amount of material applied during the application (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     applicationProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             isCarrier: Boolean (Optional)
-     *             avgMaterial (Optional): {
-     *                 unit: String (Optional)
-     *                 value: Double (Optional)
-     *             }
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *         }
-     *     ]
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(RequestOptions requestOptions) { - return this.serviceClient.listAsync(requestOptions); - } - - /** - * Create cascade delete job for application data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param partyId Id of the party. - * @param applicationDataId Id of the application data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJob(String jobId, String partyId, - String applicationDataId, RequestOptions requestOptions) { - return this.serviceClient.beginCreateCascadeDeleteJobAsync(jobId, partyId, applicationDataId, requestOptions); - } - - /** - * Get cascade delete job for application data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for application data resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponse(String jobId, - RequestOptions requestOptions) { - return this.serviceClient.getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions); - } - - /** - * Returns a paginated list of application data resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minAvgMaterialDoubleNoMinimum average amount of material applied during the application (inclusive).
maxAvgMaterialDoubleNoMaximum average amount of material applied during the application (inclusive).
minTotalMaterialDoubleNoMinimum total amount of material applied during the application (inclusive).
maxTotalMaterialDoubleNoMaximum total amount of material applied during the application (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     applicationProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             isCarrier: Boolean (Optional)
-     *             avgMaterial (Optional): {
-     *                 unit: String (Optional)
-     *                 value: Double (Optional)
-     *             }
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *         }
-     *     ]
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyId(String partyId, RequestOptions requestOptions) { - return this.serviceClient.listByPartyIdAsync(partyId, requestOptions); - } - - /** - * Get a specified application data resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     applicationProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             isCarrier: Boolean (Optional)
-     *             avgMaterial (Optional): {
-     *                 unit: String (Optional)
-     *                 value: Double (Optional)
-     *             }
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *         }
-     *     ]
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party resource. - * @param applicationDataId ID of the application data resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified application data resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String partyId, String applicationDataId, - RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(partyId, applicationDataId, requestOptions); - } - - /** - * Creates or updates an application data resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     applicationProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             isCarrier: Boolean (Optional)
-     *             avgMaterial (Optional): {
-     *                 unit: String (Optional)
-     *                 value: Double (Optional)
-     *             }
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *         }
-     *     ]
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     applicationProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             isCarrier: Boolean (Optional)
-     *             avgMaterial (Optional): {
-     *                 unit: String (Optional)
-     *                 value: Double (Optional)
-     *             }
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *         }
-     *     ]
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param applicationDataId ID of the application data resource. - * @param applicationData Application data resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of application data resource along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String partyId, String applicationDataId, - BinaryData applicationData, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(partyId, applicationDataId, applicationData, - requestOptions); - } - - /** - * Deletes a specified application data resource under a particular party. - * - * @param partyId ID of the associated party resource. - * @param applicationDataId ID of the application data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String partyId, String applicationDataId, - RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(partyId, applicationDataId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ApplicationDataClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ApplicationDataClient.java deleted file mode 100644 index 1111f3cd02e9..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ApplicationDataClient.java +++ /dev/null @@ -1,475 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.SyncPoller; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = ApplicationDataClientBuilder.class) -public final class ApplicationDataClient { - @Generated - private final ApplicationDataAsyncClient client; - - /** - * Initializes an instance of ApplicationDataClient class. - * - * @param client the async client. - */ - @Generated - ApplicationDataClient(ApplicationDataAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of application data resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minAvgMaterialDoubleNoMinimum average amount of material applied during the application (inclusive).
maxAvgMaterialDoubleNoMaximum average amount of material applied during the application (inclusive).
minTotalMaterialDoubleNoMinimum total amount of material applied during the application (inclusive).
maxTotalMaterialDoubleNoMaximum total amount of material applied during the application (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     applicationProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             isCarrier: Boolean (Optional)
-     *             avgMaterial (Optional): {
-     *                 unit: String (Optional)
-     *                 value: Double (Optional)
-     *             }
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *         }
-     *     ]
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(requestOptions)); - } - - /** - * Create cascade delete job for application data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param partyId Id of the party. - * @param applicationDataId Id of the application data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, - String applicationDataId, RequestOptions requestOptions) { - return this.client.beginCreateCascadeDeleteJob(jobId, partyId, applicationDataId, requestOptions) - .getSyncPoller(); - } - - /** - * Get cascade delete job for application data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for application data resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return this.client.getCascadeDeleteJobDetailsWithResponse(jobId, requestOptions).block(); - } - - /** - * Returns a paginated list of application data resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minAvgMaterialDoubleNoMinimum average amount of material applied during the application (inclusive).
maxAvgMaterialDoubleNoMaximum average amount of material applied during the application (inclusive).
minTotalMaterialDoubleNoMinimum total amount of material applied during the application (inclusive).
maxTotalMaterialDoubleNoMaximum total amount of material applied during the application (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     applicationProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             isCarrier: Boolean (Optional)
-     *             avgMaterial (Optional): {
-     *                 unit: String (Optional)
-     *                 value: Double (Optional)
-     *             }
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *         }
-     *     ]
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listByPartyId(partyId, requestOptions)); - } - - /** - * Get a specified application data resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     applicationProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             isCarrier: Boolean (Optional)
-     *             avgMaterial (Optional): {
-     *                 unit: String (Optional)
-     *                 value: Double (Optional)
-     *             }
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *         }
-     *     ]
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party resource. - * @param applicationDataId ID of the application data resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified application data resource under a particular party along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String applicationDataId, - RequestOptions requestOptions) { - return this.client.getWithResponse(partyId, applicationDataId, requestOptions).block(); - } - - /** - * Creates or updates an application data resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     applicationProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             isCarrier: Boolean (Optional)
-     *             avgMaterial (Optional): {
-     *                 unit: String (Optional)
-     *                 value: Double (Optional)
-     *             }
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *         }
-     *     ]
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     applicationProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             isCarrier: Boolean (Optional)
-     *             avgMaterial (Optional): {
-     *                 unit: String (Optional)
-     *                 value: Double (Optional)
-     *             }
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *         }
-     *     ]
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param applicationDataId ID of the application data resource. - * @param applicationData Application data resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of application data resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String applicationDataId, - BinaryData applicationData, RequestOptions requestOptions) { - return this.client.createOrUpdateWithResponse(partyId, applicationDataId, applicationData, requestOptions) - .block(); - } - - /** - * Deletes a specified application data resource under a particular party. - * - * @param partyId ID of the associated party resource. - * @param applicationDataId ID of the application data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String applicationDataId, RequestOptions requestOptions) { - return this.client.deleteWithResponse(partyId, applicationDataId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ApplicationDataClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ApplicationDataClientBuilder.java deleted file mode 100644 index 378ed250d702..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ApplicationDataClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the ApplicationDataClient type. */ -@ServiceClientBuilder(serviceClients = { ApplicationDataClient.class, ApplicationDataAsyncClient.class }) -public final class ApplicationDataClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the ApplicationDataClientBuilder. */ - @Generated - public ApplicationDataClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public ApplicationDataClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public ApplicationDataClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public ApplicationDataClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public ApplicationDataClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public ApplicationDataClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public ApplicationDataClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public ApplicationDataClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public ApplicationDataClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public ApplicationDataClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the ApplicationDataClientBuilder. - */ - @Generated - public ApplicationDataClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the ApplicationDataClientBuilder. - */ - @Generated - public ApplicationDataClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of ApplicationDataAsyncClient class. - * - * @return an instance of ApplicationDataAsyncClient. - */ - @Generated - public ApplicationDataAsyncClient buildAsyncClient() { - return new ApplicationDataAsyncClient(buildInnerClient().getApplicationDatas()); - } - - /** - * Builds an instance of ApplicationDataClient class. - * - * @return an instance of ApplicationDataClient. - */ - @Generated - public ApplicationDataClient buildClient() { - return new ApplicationDataClient(new ApplicationDataAsyncClient(buildInnerClient().getApplicationDatas())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/AttachmentsAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/AttachmentsAsyncClient.java deleted file mode 100644 index 97fc0dff60c8..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/AttachmentsAsyncClient.java +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.verticals.agrifood.farming.implementation.AttachmentsImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = AttachmentsClientBuilder.class, isAsync = true) -public final class AttachmentsAsyncClient { - @Generated - private final AttachmentsImpl serviceClient; - - /** - * Initializes an instance of AttachmentsAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - AttachmentsAsyncClient(AttachmentsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of attachment resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
resourceIdsList<String>NoResource Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
resourceTypesList<String>NoResource Types of the resource. - * i.e. Party, Farm, Field, SeasonalField, Boundary, ApplicationData, HarvestData, TillageData, PlantingData, PlantTissueAnalysis. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary/ApplicationData/HarvestData/TillageData/PlantingData/PlantTissueAnalysis) (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyId(String partyId, RequestOptions requestOptions) { - return this.serviceClient.listByPartyIdAsync(partyId, requestOptions); - } - - /** - * Gets a specified attachment resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary/ApplicationData/HarvestData/TillageData/PlantingData/PlantTissueAnalysis) (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param attachmentId Id of the attachment. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified attachment resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String partyId, String attachmentId, - RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(partyId, attachmentId, requestOptions); - } - - /** - * Creates or updates an attachment resource under a particular party. - * - *

Header Parameters - * - * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: "multipart/form-data".
- * - * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Request Body Schema - * - *

{@code
-     * BinaryData
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary/ApplicationData/HarvestData/TillageData/PlantingData/PlantTissueAnalysis) (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party resource. - * @param attachmentId Id of the attachment resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of attachment resource along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String partyId, String attachmentId, - RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(partyId, attachmentId, requestOptions); - } - - /** - * Deletes a specified attachment resource under a particular party. - * - * @param partyId Id of the party. - * @param attachmentId Id of the attachment. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String partyId, String attachmentId, RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(partyId, attachmentId, requestOptions); - } - - /** - * Downloads and returns attachment as response for the given input filePath. - * - *

Response Body Schema - * - *

{@code
-     * BinaryData
-     * }
- * - * @param partyId Id of the associated party. - * @param attachmentId Id of attachment to be downloaded. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> downloadWithResponse(String partyId, String attachmentId, - RequestOptions requestOptions) { - return this.serviceClient.downloadWithResponseAsync(partyId, attachmentId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/AttachmentsClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/AttachmentsClient.java deleted file mode 100644 index 001446fca254..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/AttachmentsClient.java +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = AttachmentsClientBuilder.class) -public final class AttachmentsClient { - @Generated - private final AttachmentsAsyncClient client; - - /** - * Initializes an instance of AttachmentsClient class. - * - * @param client the async client. - */ - @Generated - AttachmentsClient(AttachmentsAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of attachment resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
resourceIdsList<String>NoResource Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
resourceTypesList<String>NoResource Types of the resource. - * i.e. Party, Farm, Field, SeasonalField, Boundary, ApplicationData, HarvestData, TillageData, PlantingData, PlantTissueAnalysis. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary/ApplicationData/HarvestData/TillageData/PlantingData/PlantTissueAnalysis) (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listByPartyId(partyId, requestOptions)); - } - - /** - * Gets a specified attachment resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary/ApplicationData/HarvestData/TillageData/PlantingData/PlantTissueAnalysis) (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param attachmentId Id of the attachment. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified attachment resource under a particular party along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String attachmentId, RequestOptions requestOptions) { - return this.client.getWithResponse(partyId, attachmentId, requestOptions).block(); - } - - /** - * Creates or updates an attachment resource under a particular party. - * - *

Header Parameters - * - * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: "multipart/form-data".
- * - * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Request Body Schema - * - *

{@code
-     * BinaryData
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary/ApplicationData/HarvestData/TillageData/PlantingData/PlantTissueAnalysis) (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party resource. - * @param attachmentId Id of the attachment resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of attachment resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String attachmentId, - RequestOptions requestOptions) { - return this.client.createOrUpdateWithResponse(partyId, attachmentId, requestOptions).block(); - } - - /** - * Deletes a specified attachment resource under a particular party. - * - * @param partyId Id of the party. - * @param attachmentId Id of the attachment. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String attachmentId, RequestOptions requestOptions) { - return this.client.deleteWithResponse(partyId, attachmentId, requestOptions).block(); - } - - /** - * Downloads and returns attachment as response for the given input filePath. - * - *

Response Body Schema - * - *

{@code
-     * BinaryData
-     * }
- * - * @param partyId Id of the associated party. - * @param attachmentId Id of attachment to be downloaded. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response downloadWithResponse(String partyId, String attachmentId, - RequestOptions requestOptions) { - return this.client.downloadWithResponse(partyId, attachmentId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/AttachmentsClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/AttachmentsClientBuilder.java deleted file mode 100644 index 73dafb9e3117..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/AttachmentsClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the AttachmentsClient type. */ -@ServiceClientBuilder(serviceClients = { AttachmentsClient.class, AttachmentsAsyncClient.class }) -public final class AttachmentsClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the AttachmentsClientBuilder. */ - @Generated - public AttachmentsClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public AttachmentsClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public AttachmentsClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public AttachmentsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public AttachmentsClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public AttachmentsClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public AttachmentsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public AttachmentsClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public AttachmentsClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public AttachmentsClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the AttachmentsClientBuilder. - */ - @Generated - public AttachmentsClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the AttachmentsClientBuilder. - */ - @Generated - public AttachmentsClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of AttachmentsAsyncClient class. - * - * @return an instance of AttachmentsAsyncClient. - */ - @Generated - public AttachmentsAsyncClient buildAsyncClient() { - return new AttachmentsAsyncClient(buildInnerClient().getAttachments()); - } - - /** - * Builds an instance of AttachmentsClient class. - * - * @return an instance of AttachmentsClient. - */ - @Generated - public AttachmentsClient buildClient() { - return new AttachmentsClient(new AttachmentsAsyncClient(buildInnerClient().getAttachments())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/BoundariesAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/BoundariesAsyncClient.java deleted file mode 100644 index 47dc5d7b61d7..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/BoundariesAsyncClient.java +++ /dev/null @@ -1,609 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollerFlux; -import com.azure.verticals.agrifood.farming.implementation.BoundariesImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = BoundariesClientBuilder.class, isAsync = true) -public final class BoundariesAsyncClient { - @Generated - private final BoundariesImpl serviceClient; - - /** - * Initializes an instance of BoundariesAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - BoundariesAsyncClient(BoundariesImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of boundary resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
parentTypeStringNoType of the parent it belongs to.
typeStringNoType it belongs to.
parentIdsList<String>NoParent Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minAreaDoubleNoMinimum area of the boundary (inclusive).
maxAreaDoubleNoMaximum acreage of the boundary (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(RequestOptions requestOptions) { - return this.serviceClient.listAsync(requestOptions); - } - - /** - * Search for boundaries across all parties by fields and intersecting geometry. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     ids (Optional): [
-     *         String (Optional)
-     *     ]
-     *     names (Optional): [
-     *         String (Optional)
-     *     ]
-     *     propertyFilters (Optional): [
-     *         String (Optional)
-     *     ]
-     *     statuses (Optional): [
-     *         String (Optional)
-     *     ]
-     *     minCreatedDateTime: OffsetDateTime (Optional)
-     *     maxCreatedDateTime: OffsetDateTime (Optional)
-     *     minLastModifiedDateTime: OffsetDateTime (Optional)
-     *     maxLastModifiedDateTime: OffsetDateTime (Optional)
-     *     maxPageSize: Integer (Optional)
-     *     skipToken: String (Optional)
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     parentIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     minArea: Double (Optional)
-     *     maxArea: Double (Optional)
-     *     intersectsWithGeometry (Optional): {
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param searchBoundaryQuery Query filters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux search(BinaryData searchBoundaryQuery, RequestOptions requestOptions) { - return this.serviceClient.searchAsync(searchBoundaryQuery, requestOptions); - } - - /** - * Create a cascade delete job for specified boundary. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param boundaryId ID of the boundary to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJob(String jobId, String partyId, - String boundaryId, RequestOptions requestOptions) { - return this.serviceClient.beginCreateCascadeDeleteJobAsync(jobId, partyId, boundaryId, requestOptions); - } - - /** - * Get cascade delete job for specified boundary. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for specified boundary along with {@link Response} on successful completion of {@link - * Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponse(String jobId, - RequestOptions requestOptions) { - return this.serviceClient.getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions); - } - - /** - * Returns a paginated list of boundary resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
parentTypeStringNoType of the parent it belongs to.
typeStringNoType it belongs to.
parentIdsList<String>NoParent Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minAreaDoubleNoMinimum area of the boundary (inclusive).
maxAreaDoubleNoMaximum acreage of the boundary (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyId(String partyId, RequestOptions requestOptions) { - return this.serviceClient.listByPartyIdAsync(partyId, requestOptions); - } - - /** - * Search for boundaries by fields and intersecting geometry. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     ids (Optional): [
-     *         String (Optional)
-     *     ]
-     *     names (Optional): [
-     *         String (Optional)
-     *     ]
-     *     propertyFilters (Optional): [
-     *         String (Optional)
-     *     ]
-     *     statuses (Optional): [
-     *         String (Optional)
-     *     ]
-     *     minCreatedDateTime: OffsetDateTime (Optional)
-     *     maxCreatedDateTime: OffsetDateTime (Optional)
-     *     minLastModifiedDateTime: OffsetDateTime (Optional)
-     *     maxLastModifiedDateTime: OffsetDateTime (Optional)
-     *     maxPageSize: Integer (Optional)
-     *     skipToken: String (Optional)
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     parentIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     minArea: Double (Optional)
-     *     maxArea: Double (Optional)
-     *     intersectsWithGeometry (Optional): {
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party. - * @param searchBoundaryQuery Query filters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux searchByPartyId(String partyId, BinaryData searchBoundaryQuery, - RequestOptions requestOptions) { - return this.serviceClient.searchByPartyIdAsync(partyId, searchBoundaryQuery, requestOptions); - } - - /** - * Creates or updates a boundary resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     geometry (Optional): {
-     *     }
-     *     type: String (Optional)
-     *     crs: String (Optional)
-     *     centroid (Optional): (recursive schema, see centroid above)
-     *     bbox (Optional): (recursive schema, see bbox above)
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     geometry (Optional): {
-     *     }
-     *     type: String (Optional)
-     *     crs: String (Optional)
-     *     centroid (Optional): (recursive schema, see centroid above)
-     *     bbox (Optional): (recursive schema, see bbox above)
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party resource. - * @param boundaryId Id of the boundary resource. - * @param boundary Boundary resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of boundary resource along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String partyId, String boundaryId, BinaryData boundary, - RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(partyId, boundaryId, boundary, requestOptions); - } - - /** - * Gets a specified boundary resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     geometry (Optional): {
-     *     }
-     *     type: String (Optional)
-     *     crs: String (Optional)
-     *     centroid (Optional): (recursive schema, see centroid above)
-     *     bbox (Optional): (recursive schema, see bbox above)
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param boundaryId Id of the boundary. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified boundary resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String partyId, String boundaryId, - RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(partyId, boundaryId, requestOptions); - } - - /** - * Deletes a specified boundary resource under a particular party. - * - * @param partyId Id of the party. - * @param boundaryId Id of the boundary. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String partyId, String boundaryId, RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(partyId, boundaryId, requestOptions); - } - - /** - * Returns overlapping area between two boundary Ids. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     boundaryArea: Double (Optional)
-     *     otherBoundaryArea: Double (Optional)
-     *     intersectingArea: Double (Optional)
-     * }
-     * }
- * - * @param partyId Id of the party. - * @param boundaryId Id of the boundary. - * @param otherPartyId PartyId of the other field. - * @param otherBoundaryId Id of the other boundary. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of boundary overlap response along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getOverlapWithResponse(String partyId, String boundaryId, String otherPartyId, - String otherBoundaryId, RequestOptions requestOptions) { - return this.serviceClient.getOverlapWithResponseAsync(partyId, boundaryId, otherPartyId, otherBoundaryId, - requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/BoundariesClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/BoundariesClient.java deleted file mode 100644 index d041ffd71f1e..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/BoundariesClient.java +++ /dev/null @@ -1,603 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.SyncPoller; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = BoundariesClientBuilder.class) -public final class BoundariesClient { - @Generated - private final BoundariesAsyncClient client; - - /** - * Initializes an instance of BoundariesClient class. - * - * @param client the async client. - */ - @Generated - BoundariesClient(BoundariesAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of boundary resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
parentTypeStringNoType of the parent it belongs to.
typeStringNoType it belongs to.
parentIdsList<String>NoParent Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minAreaDoubleNoMinimum area of the boundary (inclusive).
maxAreaDoubleNoMaximum acreage of the boundary (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(requestOptions)); - } - - /** - * Search for boundaries across all parties by fields and intersecting geometry. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     ids (Optional): [
-     *         String (Optional)
-     *     ]
-     *     names (Optional): [
-     *         String (Optional)
-     *     ]
-     *     propertyFilters (Optional): [
-     *         String (Optional)
-     *     ]
-     *     statuses (Optional): [
-     *         String (Optional)
-     *     ]
-     *     minCreatedDateTime: OffsetDateTime (Optional)
-     *     maxCreatedDateTime: OffsetDateTime (Optional)
-     *     minLastModifiedDateTime: OffsetDateTime (Optional)
-     *     maxLastModifiedDateTime: OffsetDateTime (Optional)
-     *     maxPageSize: Integer (Optional)
-     *     skipToken: String (Optional)
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     parentIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     minArea: Double (Optional)
-     *     maxArea: Double (Optional)
-     *     intersectsWithGeometry (Optional): {
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param searchBoundaryQuery Query filters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable search(BinaryData searchBoundaryQuery, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.search(searchBoundaryQuery, requestOptions)); - } - - /** - * Create a cascade delete job for specified boundary. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param boundaryId ID of the boundary to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, - String boundaryId, RequestOptions requestOptions) { - return this.client.beginCreateCascadeDeleteJob(jobId, partyId, boundaryId, requestOptions).getSyncPoller(); - } - - /** - * Get cascade delete job for specified boundary. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for specified boundary along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return this.client.getCascadeDeleteJobDetailsWithResponse(jobId, requestOptions).block(); - } - - /** - * Returns a paginated list of boundary resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
parentTypeStringNoType of the parent it belongs to.
typeStringNoType it belongs to.
parentIdsList<String>NoParent Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minAreaDoubleNoMinimum area of the boundary (inclusive).
maxAreaDoubleNoMaximum acreage of the boundary (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listByPartyId(partyId, requestOptions)); - } - - /** - * Search for boundaries by fields and intersecting geometry. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     ids (Optional): [
-     *         String (Optional)
-     *     ]
-     *     names (Optional): [
-     *         String (Optional)
-     *     ]
-     *     propertyFilters (Optional): [
-     *         String (Optional)
-     *     ]
-     *     statuses (Optional): [
-     *         String (Optional)
-     *     ]
-     *     minCreatedDateTime: OffsetDateTime (Optional)
-     *     maxCreatedDateTime: OffsetDateTime (Optional)
-     *     minLastModifiedDateTime: OffsetDateTime (Optional)
-     *     maxLastModifiedDateTime: OffsetDateTime (Optional)
-     *     maxPageSize: Integer (Optional)
-     *     skipToken: String (Optional)
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     parentIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     minArea: Double (Optional)
-     *     maxArea: Double (Optional)
-     *     intersectsWithGeometry (Optional): {
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party. - * @param searchBoundaryQuery Query filters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable searchByPartyId(String partyId, BinaryData searchBoundaryQuery, - RequestOptions requestOptions) { - return new PagedIterable<>(this.client.searchByPartyId(partyId, searchBoundaryQuery, requestOptions)); - } - - /** - * Creates or updates a boundary resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     geometry (Optional): {
-     *     }
-     *     type: String (Optional)
-     *     crs: String (Optional)
-     *     centroid (Optional): (recursive schema, see centroid above)
-     *     bbox (Optional): (recursive schema, see bbox above)
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     geometry (Optional): {
-     *     }
-     *     type: String (Optional)
-     *     crs: String (Optional)
-     *     centroid (Optional): (recursive schema, see centroid above)
-     *     bbox (Optional): (recursive schema, see bbox above)
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party resource. - * @param boundaryId Id of the boundary resource. - * @param boundary Boundary resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of boundary resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String boundaryId, BinaryData boundary, - RequestOptions requestOptions) { - return this.client.createOrUpdateWithResponse(partyId, boundaryId, boundary, requestOptions).block(); - } - - /** - * Gets a specified boundary resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     geometry (Optional): {
-     *     }
-     *     type: String (Optional)
-     *     crs: String (Optional)
-     *     centroid (Optional): (recursive schema, see centroid above)
-     *     bbox (Optional): (recursive schema, see bbox above)
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param boundaryId Id of the boundary. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified boundary resource under a particular party along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String boundaryId, RequestOptions requestOptions) { - return this.client.getWithResponse(partyId, boundaryId, requestOptions).block(); - } - - /** - * Deletes a specified boundary resource under a particular party. - * - * @param partyId Id of the party. - * @param boundaryId Id of the boundary. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String boundaryId, RequestOptions requestOptions) { - return this.client.deleteWithResponse(partyId, boundaryId, requestOptions).block(); - } - - /** - * Returns overlapping area between two boundary Ids. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     boundaryArea: Double (Optional)
-     *     otherBoundaryArea: Double (Optional)
-     *     intersectingArea: Double (Optional)
-     * }
-     * }
- * - * @param partyId Id of the party. - * @param boundaryId Id of the boundary. - * @param otherPartyId PartyId of the other field. - * @param otherBoundaryId Id of the other boundary. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of boundary overlap response along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getOverlapWithResponse(String partyId, String boundaryId, String otherPartyId, - String otherBoundaryId, RequestOptions requestOptions) { - return this.client.getOverlapWithResponse(partyId, boundaryId, otherPartyId, otherBoundaryId, requestOptions) - .block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/BoundariesClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/BoundariesClientBuilder.java deleted file mode 100644 index 7c43aa2cde18..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/BoundariesClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the BoundariesClient type. */ -@ServiceClientBuilder(serviceClients = { BoundariesClient.class, BoundariesAsyncClient.class }) -public final class BoundariesClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the BoundariesClientBuilder. */ - @Generated - public BoundariesClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public BoundariesClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public BoundariesClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public BoundariesClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public BoundariesClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public BoundariesClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public BoundariesClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public BoundariesClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public BoundariesClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public BoundariesClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the BoundariesClientBuilder. - */ - @Generated - public BoundariesClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the BoundariesClientBuilder. - */ - @Generated - public BoundariesClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of BoundariesAsyncClient class. - * - * @return an instance of BoundariesAsyncClient. - */ - @Generated - public BoundariesAsyncClient buildAsyncClient() { - return new BoundariesAsyncClient(buildInnerClient().getBoundaries()); - } - - /** - * Builds an instance of BoundariesClient class. - * - * @return an instance of BoundariesClient. - */ - @Generated - public BoundariesClient buildClient() { - return new BoundariesClient(new BoundariesAsyncClient(buildInnerClient().getBoundaries())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/CropProductsAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/CropProductsAsyncClient.java deleted file mode 100644 index 74d5518d6368..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/CropProductsAsyncClient.java +++ /dev/null @@ -1,264 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.verticals.agrifood.farming.implementation.CropProductsImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = CropProductsClientBuilder.class, isAsync = true) -public final class CropProductsAsyncClient { - @Generated - private final CropProductsImpl serviceClient; - - /** - * Initializes an instance of CropProductsAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - CropProductsAsyncClient(CropProductsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of crop product resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
cropIdsList<String>NoCropIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
brandsList<String>NoBrands of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
productsList<String>NoProducts of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
traitsList<String>NoTraits of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     cropIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     brand: String (Optional)
-     *     product: String (Optional)
-     *     trait: String (Optional)
-     *     relativeMaturity (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     treatments (Optional): [
-     *         String (Optional)
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(RequestOptions requestOptions) { - return this.serviceClient.listAsync(requestOptions); - } - - /** - * Gets a specified crop Product resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     cropIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     brand: String (Optional)
-     *     product: String (Optional)
-     *     trait: String (Optional)
-     *     relativeMaturity (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     treatments (Optional): [
-     *         String (Optional)
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param cropProductId Id of the crop Product. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified crop Product resource along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String cropProductId, RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(cropProductId, requestOptions); - } - - /** - * Creates or updates a crop Product resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     cropIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     brand: String (Optional)
-     *     product: String (Optional)
-     *     trait: String (Optional)
-     *     relativeMaturity (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     treatments (Optional): [
-     *         String (Optional)
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     cropIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     brand: String (Optional)
-     *     product: String (Optional)
-     *     trait: String (Optional)
-     *     relativeMaturity (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     treatments (Optional): [
-     *         String (Optional)
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param cropProductId Id of the crop Product resource. - * @param cropProduct Crop Product resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of crop product resource along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String cropProductId, BinaryData cropProduct, - RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(cropProductId, cropProduct, requestOptions); - } - - /** - * Deletes a specified crop Product resource. - * - * @param cropProductId Id of the crop Product. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String cropProductId, RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(cropProductId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/CropProductsClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/CropProductsClient.java deleted file mode 100644 index a5dfbc0b45a1..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/CropProductsClient.java +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = CropProductsClientBuilder.class) -public final class CropProductsClient { - @Generated - private final CropProductsAsyncClient client; - - /** - * Initializes an instance of CropProductsClient class. - * - * @param client the async client. - */ - @Generated - CropProductsClient(CropProductsAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of crop product resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
cropIdsList<String>NoCropIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
brandsList<String>NoBrands of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
productsList<String>NoProducts of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
traitsList<String>NoTraits of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     cropIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     brand: String (Optional)
-     *     product: String (Optional)
-     *     trait: String (Optional)
-     *     relativeMaturity (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     treatments (Optional): [
-     *         String (Optional)
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(requestOptions)); - } - - /** - * Gets a specified crop Product resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     cropIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     brand: String (Optional)
-     *     product: String (Optional)
-     *     trait: String (Optional)
-     *     relativeMaturity (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     treatments (Optional): [
-     *         String (Optional)
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param cropProductId Id of the crop Product. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified crop Product resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String cropProductId, RequestOptions requestOptions) { - return this.client.getWithResponse(cropProductId, requestOptions).block(); - } - - /** - * Creates or updates a crop Product resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     cropIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     brand: String (Optional)
-     *     product: String (Optional)
-     *     trait: String (Optional)
-     *     relativeMaturity (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     treatments (Optional): [
-     *         String (Optional)
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     cropIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     brand: String (Optional)
-     *     product: String (Optional)
-     *     trait: String (Optional)
-     *     relativeMaturity (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     treatments (Optional): [
-     *         String (Optional)
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param cropProductId Id of the crop Product resource. - * @param cropProduct Crop Product resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of crop product resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String cropProductId, BinaryData cropProduct, - RequestOptions requestOptions) { - return this.client.createOrUpdateWithResponse(cropProductId, cropProduct, requestOptions).block(); - } - - /** - * Deletes a specified crop Product resource. - * - * @param cropProductId Id of the crop Product. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String cropProductId, RequestOptions requestOptions) { - return this.client.deleteWithResponse(cropProductId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/CropProductsClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/CropProductsClientBuilder.java deleted file mode 100644 index 44f2bfd843ce..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/CropProductsClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the CropProductsClient type. */ -@ServiceClientBuilder(serviceClients = { CropProductsClient.class, CropProductsAsyncClient.class }) -public final class CropProductsClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the CropProductsClientBuilder. */ - @Generated - public CropProductsClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public CropProductsClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public CropProductsClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public CropProductsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public CropProductsClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public CropProductsClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public CropProductsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public CropProductsClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public CropProductsClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public CropProductsClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the CropProductsClientBuilder. - */ - @Generated - public CropProductsClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the CropProductsClientBuilder. - */ - @Generated - public CropProductsClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of CropProductsAsyncClient class. - * - * @return an instance of CropProductsAsyncClient. - */ - @Generated - public CropProductsAsyncClient buildAsyncClient() { - return new CropProductsAsyncClient(buildInnerClient().getCropProducts()); - } - - /** - * Builds an instance of CropProductsClient class. - * - * @return an instance of CropProductsClient. - */ - @Generated - public CropProductsClient buildClient() { - return new CropProductsClient(new CropProductsAsyncClient(buildInnerClient().getCropProducts())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/CropsAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/CropsAsyncClient.java deleted file mode 100644 index bb2ec345a66a..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/CropsAsyncClient.java +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.verticals.agrifood.farming.implementation.CropsImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = CropsClientBuilder.class, isAsync = true) -public final class CropsAsyncClient { - @Generated - private final CropsImpl serviceClient; - - /** - * Initializes an instance of CropsAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - CropsAsyncClient(CropsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of crop resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
phenotypesList<String>NoCrop phenotypes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
breedingMethodsList<String>NoBreeding method of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     phenotype: String (Optional)
-     *     breedingMethod: String(VARIETY/HYBRID/UNKNOWN) (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(RequestOptions requestOptions) { - return this.serviceClient.listAsync(requestOptions); - } - - /** - * Gets a specified crop resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     phenotype: String (Optional)
-     *     breedingMethod: String(VARIETY/HYBRID/UNKNOWN) (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param cropId Id of the crop. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified crop resource along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String cropId, RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(cropId, requestOptions); - } - - /** - * Creates or updates a crop resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     phenotype: String (Optional)
-     *     breedingMethod: String(VARIETY/HYBRID/UNKNOWN) (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     phenotype: String (Optional)
-     *     breedingMethod: String(VARIETY/HYBRID/UNKNOWN) (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param cropId Id of the crop resource. - * @param crop Crop resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of crop resource along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String cropId, BinaryData crop, - RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(cropId, crop, requestOptions); - } - - /** - * Deletes Crop for given crop id. - * - * @param cropId Id of crop to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String cropId, RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(cropId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/CropsClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/CropsClient.java deleted file mode 100644 index 9ae4d724e885..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/CropsClient.java +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = CropsClientBuilder.class) -public final class CropsClient { - @Generated - private final CropsAsyncClient client; - - /** - * Initializes an instance of CropsClient class. - * - * @param client the async client. - */ - @Generated - CropsClient(CropsAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of crop resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
phenotypesList<String>NoCrop phenotypes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
breedingMethodsList<String>NoBreeding method of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     phenotype: String (Optional)
-     *     breedingMethod: String(VARIETY/HYBRID/UNKNOWN) (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(requestOptions)); - } - - /** - * Gets a specified crop resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     phenotype: String (Optional)
-     *     breedingMethod: String(VARIETY/HYBRID/UNKNOWN) (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param cropId Id of the crop. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified crop resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String cropId, RequestOptions requestOptions) { - return this.client.getWithResponse(cropId, requestOptions).block(); - } - - /** - * Creates or updates a crop resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     phenotype: String (Optional)
-     *     breedingMethod: String(VARIETY/HYBRID/UNKNOWN) (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     phenotype: String (Optional)
-     *     breedingMethod: String(VARIETY/HYBRID/UNKNOWN) (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param cropId Id of the crop resource. - * @param crop Crop resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of crop resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String cropId, BinaryData crop, - RequestOptions requestOptions) { - return this.client.createOrUpdateWithResponse(cropId, crop, requestOptions).block(); - } - - /** - * Deletes Crop for given crop id. - * - * @param cropId Id of crop to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String cropId, RequestOptions requestOptions) { - return this.client.deleteWithResponse(cropId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/CropsClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/CropsClientBuilder.java deleted file mode 100644 index b321376c6179..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/CropsClientBuilder.java +++ /dev/null @@ -1,301 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the CropsClient type. */ -@ServiceClientBuilder(serviceClients = { CropsClient.class, CropsAsyncClient.class }) -public final class CropsClientBuilder implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the CropsClientBuilder. */ - @Generated - public CropsClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public CropsClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public CropsClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public CropsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public CropsClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public CropsClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public CropsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public CropsClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public CropsClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public CropsClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the CropsClientBuilder. - */ - @Generated - public CropsClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the CropsClientBuilder. - */ - @Generated - public CropsClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of CropsAsyncClient class. - * - * @return an instance of CropsAsyncClient. - */ - @Generated - public CropsAsyncClient buildAsyncClient() { - return new CropsAsyncClient(buildInnerClient().getCrops()); - } - - /** - * Builds an instance of CropsClient class. - * - * @return an instance of CropsClient. - */ - @Generated - public CropsClient buildClient() { - return new CropsClient(new CropsAsyncClient(buildInnerClient().getCrops())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/DeviceDataModelsAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/DeviceDataModelsAsyncClient.java deleted file mode 100644 index 456647fe0ac4..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/DeviceDataModelsAsyncClient.java +++ /dev/null @@ -1,251 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.verticals.agrifood.farming.implementation.DeviceDataModelsImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = DeviceDataModelsClientBuilder.class, isAsync = true) -public final class DeviceDataModelsAsyncClient { - @Generated - private final DeviceDataModelsImpl serviceClient; - - /** - * Initializes an instance of DeviceDataModelsAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - DeviceDataModelsAsyncClient(DeviceDataModelsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of device data model resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     ports (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(String sensorPartnerId, RequestOptions requestOptions) { - return this.serviceClient.listAsync(sensorPartnerId, requestOptions); - } - - /** - * Create a device data model entity. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     ports (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     ports (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param deviceDataModelId Id of the device data model. - * @param deviceDataModelObject Device data model object details. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return deviceDataModel API model along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String sensorPartnerId, String deviceDataModelId, - BinaryData deviceDataModelObject, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(sensorPartnerId, deviceDataModelId, - deviceDataModelObject, requestOptions); - } - - /** - * Gets a device data model entity. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     ports (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param deviceDataModelId Id of the device data model resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a device data model entity along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String sensorPartnerId, String deviceDataModelId, - RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(sensorPartnerId, deviceDataModelId, requestOptions); - } - - /** - * Deletes a device data model entity. - * - * @param sensorPartnerId Id of the sensor partner. - * @param deviceDataModelId Id of the device data model resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String sensorPartnerId, String deviceDataModelId, - RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(sensorPartnerId, deviceDataModelId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/DeviceDataModelsClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/DeviceDataModelsClient.java deleted file mode 100644 index b2d8b653bcb7..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/DeviceDataModelsClient.java +++ /dev/null @@ -1,250 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = DeviceDataModelsClientBuilder.class) -public final class DeviceDataModelsClient { - @Generated - private final DeviceDataModelsAsyncClient client; - - /** - * Initializes an instance of DeviceDataModelsClient class. - * - * @param client the async client. - */ - @Generated - DeviceDataModelsClient(DeviceDataModelsAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of device data model resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     ports (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String sensorPartnerId, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(sensorPartnerId, requestOptions)); - } - - /** - * Create a device data model entity. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     ports (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     ports (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param deviceDataModelId Id of the device data model. - * @param deviceDataModelObject Device data model object details. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return deviceDataModel API model along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String sensorPartnerId, String deviceDataModelId, - BinaryData deviceDataModelObject, RequestOptions requestOptions) { - return this.client - .createOrUpdateWithResponse(sensorPartnerId, deviceDataModelId, deviceDataModelObject, requestOptions) - .block(); - } - - /** - * Gets a device data model entity. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     ports (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param deviceDataModelId Id of the device data model resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a device data model entity along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String sensorPartnerId, String deviceDataModelId, - RequestOptions requestOptions) { - return this.client.getWithResponse(sensorPartnerId, deviceDataModelId, requestOptions).block(); - } - - /** - * Deletes a device data model entity. - * - * @param sensorPartnerId Id of the sensor partner. - * @param deviceDataModelId Id of the device data model resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String sensorPartnerId, String deviceDataModelId, - RequestOptions requestOptions) { - return this.client.deleteWithResponse(sensorPartnerId, deviceDataModelId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/DeviceDataModelsClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/DeviceDataModelsClientBuilder.java deleted file mode 100644 index dc215521b864..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/DeviceDataModelsClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the DeviceDataModelsClient type. */ -@ServiceClientBuilder(serviceClients = { DeviceDataModelsClient.class, DeviceDataModelsAsyncClient.class }) -public final class DeviceDataModelsClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the DeviceDataModelsClientBuilder. */ - @Generated - public DeviceDataModelsClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public DeviceDataModelsClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public DeviceDataModelsClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public DeviceDataModelsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public DeviceDataModelsClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public DeviceDataModelsClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public DeviceDataModelsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public DeviceDataModelsClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public DeviceDataModelsClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public DeviceDataModelsClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the DeviceDataModelsClientBuilder. - */ - @Generated - public DeviceDataModelsClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the DeviceDataModelsClientBuilder. - */ - @Generated - public DeviceDataModelsClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of DeviceDataModelsAsyncClient class. - * - * @return an instance of DeviceDataModelsAsyncClient. - */ - @Generated - public DeviceDataModelsAsyncClient buildAsyncClient() { - return new DeviceDataModelsAsyncClient(buildInnerClient().getDeviceDataModels()); - } - - /** - * Builds an instance of DeviceDataModelsClient class. - * - * @return an instance of DeviceDataModelsClient. - */ - @Generated - public DeviceDataModelsClient buildClient() { - return new DeviceDataModelsClient(new DeviceDataModelsAsyncClient(buildInnerClient().getDeviceDataModels())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/DevicesAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/DevicesAsyncClient.java deleted file mode 100644 index aca607c09318..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/DevicesAsyncClient.java +++ /dev/null @@ -1,257 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.verticals.agrifood.farming.implementation.DevicesImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = DevicesClientBuilder.class, isAsync = true) -public final class DevicesAsyncClient { - @Generated - private final DevicesImpl serviceClient; - - /** - * Initializes an instance of DevicesAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - DevicesAsyncClient(DevicesImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of device resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
parentDeviceIdsList<String>NoId's of the parent devices. Call {@link RequestOptions#addQueryParam} to add string to array.
deviceDataModelIdsList<String>NoId's of the device data models. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     deviceDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     type: String (Optional)
-     *     hardwareId: String (Optional)
-     *     reportingIntervalInSeconds: Integer (Optional)
-     *     parentDeviceId: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(String sensorPartnerId, RequestOptions requestOptions) { - return this.serviceClient.listAsync(sensorPartnerId, requestOptions); - } - - /** - * Create a device entity. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     deviceDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     type: String (Optional)
-     *     hardwareId: String (Optional)
-     *     reportingIntervalInSeconds: Integer (Optional)
-     *     parentDeviceId: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     deviceDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     type: String (Optional)
-     *     hardwareId: String (Optional)
-     *     reportingIntervalInSeconds: Integer (Optional)
-     *     parentDeviceId: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param deviceId Id of the device resource. - * @param deviceDetails Device object details. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return device API model along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String sensorPartnerId, String deviceId, - BinaryData deviceDetails, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(sensorPartnerId, deviceId, deviceDetails, - requestOptions); - } - - /** - * Gets a device entity. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     deviceDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     type: String (Optional)
-     *     hardwareId: String (Optional)
-     *     reportingIntervalInSeconds: Integer (Optional)
-     *     parentDeviceId: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param deviceId Id of the device resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a device entity along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String sensorPartnerId, String deviceId, - RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(sensorPartnerId, deviceId, requestOptions); - } - - /** - * Deletes a device entity. - * - * @param sensorPartnerId Id of the sensor partner. - * @param deviceId Id of the device resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String sensorPartnerId, String deviceId, - RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(sensorPartnerId, deviceId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/DevicesClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/DevicesClient.java deleted file mode 100644 index d476285b5003..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/DevicesClient.java +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = DevicesClientBuilder.class) -public final class DevicesClient { - @Generated - private final DevicesAsyncClient client; - - /** - * Initializes an instance of DevicesClient class. - * - * @param client the async client. - */ - @Generated - DevicesClient(DevicesAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of device resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
parentDeviceIdsList<String>NoId's of the parent devices. Call {@link RequestOptions#addQueryParam} to add string to array.
deviceDataModelIdsList<String>NoId's of the device data models. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     deviceDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     type: String (Optional)
-     *     hardwareId: String (Optional)
-     *     reportingIntervalInSeconds: Integer (Optional)
-     *     parentDeviceId: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String sensorPartnerId, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(sensorPartnerId, requestOptions)); - } - - /** - * Create a device entity. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     deviceDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     type: String (Optional)
-     *     hardwareId: String (Optional)
-     *     reportingIntervalInSeconds: Integer (Optional)
-     *     parentDeviceId: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     deviceDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     type: String (Optional)
-     *     hardwareId: String (Optional)
-     *     reportingIntervalInSeconds: Integer (Optional)
-     *     parentDeviceId: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param deviceId Id of the device resource. - * @param deviceDetails Device object details. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return device API model along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String sensorPartnerId, String deviceId, - BinaryData deviceDetails, RequestOptions requestOptions) { - return this.client.createOrUpdateWithResponse(sensorPartnerId, deviceId, deviceDetails, requestOptions).block(); - } - - /** - * Gets a device entity. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     deviceDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     type: String (Optional)
-     *     hardwareId: String (Optional)
-     *     reportingIntervalInSeconds: Integer (Optional)
-     *     parentDeviceId: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param deviceId Id of the device resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a device entity along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String sensorPartnerId, String deviceId, - RequestOptions requestOptions) { - return this.client.getWithResponse(sensorPartnerId, deviceId, requestOptions).block(); - } - - /** - * Deletes a device entity. - * - * @param sensorPartnerId Id of the sensor partner. - * @param deviceId Id of the device resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String sensorPartnerId, String deviceId, RequestOptions requestOptions) { - return this.client.deleteWithResponse(sensorPartnerId, deviceId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/DevicesClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/DevicesClientBuilder.java deleted file mode 100644 index fc46e0928a56..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/DevicesClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the DevicesClient type. */ -@ServiceClientBuilder(serviceClients = { DevicesClient.class, DevicesAsyncClient.class }) -public final class DevicesClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the DevicesClientBuilder. */ - @Generated - public DevicesClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public DevicesClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public DevicesClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public DevicesClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public DevicesClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public DevicesClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public DevicesClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public DevicesClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public DevicesClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public DevicesClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the DevicesClientBuilder. - */ - @Generated - public DevicesClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the DevicesClientBuilder. - */ - @Generated - public DevicesClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of DevicesAsyncClient class. - * - * @return an instance of DevicesAsyncClient. - */ - @Generated - public DevicesAsyncClient buildAsyncClient() { - return new DevicesAsyncClient(buildInnerClient().getDevices()); - } - - /** - * Builds an instance of DevicesClient class. - * - * @return an instance of DevicesClient. - */ - @Generated - public DevicesClient buildClient() { - return new DevicesClient(new DevicesAsyncClient(buildInnerClient().getDevices())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FarmBeatsServiceVersion.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FarmBeatsServiceVersion.java deleted file mode 100644 index 78a5df82c288..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FarmBeatsServiceVersion.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.util.ServiceVersion; - -/** Service version of FarmBeatsClient. */ -public enum FarmBeatsServiceVersion implements ServiceVersion { - /** Enum value 2022-11-01-preview. */ - V2022_11_01_PREVIEW("2022-11-01-preview"); - - private final String version; - - FarmBeatsServiceVersion(String version) { - this.version = version; - } - - /** {@inheritDoc} */ - @Override - public String getVersion() { - return this.version; - } - - /** - * Gets the latest service version supported by this client library. - * - * @return The latest {@link FarmBeatsServiceVersion}. - */ - public static FarmBeatsServiceVersion getLatest() { - return V2022_11_01_PREVIEW; - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FarmOperationsAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FarmOperationsAsyncClient.java deleted file mode 100644 index 7a8c55dcc059..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FarmOperationsAsyncClient.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollerFlux; -import com.azure.verticals.agrifood.farming.implementation.FarmOperationsImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = FarmOperationsClientBuilder.class, isAsync = true) -public final class FarmOperationsAsyncClient { - @Generated - private final FarmOperationsImpl serviceClient; - - /** - * Initializes an instance of FarmOperationsAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - FarmOperationsAsyncClient(FarmOperationsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Create a farm operation data ingestion job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     authProviderId: String (Required)
-     *     operations (Optional): [
-     *         String (Optional)
-     *     ]
-     *     startYear: int (Required)
-     *     isIncremental: Boolean (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     authProviderId: String (Required)
-     *     operations (Optional): [
-     *         String (Optional)
-     *     ]
-     *     startYear: int (Required)
-     *     isIncremental: Boolean (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Job Id supplied by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of farm operation data ingestion job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateDataIngestionJob(String jobId, BinaryData job, - RequestOptions requestOptions) { - return this.serviceClient.beginCreateDataIngestionJobAsync(jobId, job, requestOptions); - } - - /** - * Get a farm operation data ingestion job. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     authProviderId: String (Required)
-     *     operations (Optional): [
-     *         String (Optional)
-     *     ]
-     *     startYear: int (Required)
-     *     isIncremental: Boolean (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a farm operation data ingestion job along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDataIngestionJobDetailsWithResponse(String jobId, - RequestOptions requestOptions) { - return this.serviceClient.getDataIngestionJobDetailsWithResponseAsync(jobId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FarmOperationsClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FarmOperationsClient.java deleted file mode 100644 index b1db8a750512..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FarmOperationsClient.java +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.SyncPoller; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = FarmOperationsClientBuilder.class) -public final class FarmOperationsClient { - @Generated - private final FarmOperationsAsyncClient client; - - /** - * Initializes an instance of FarmOperationsClient class. - * - * @param client the async client. - */ - @Generated - FarmOperationsClient(FarmOperationsAsyncClient client) { - this.client = client; - } - - /** - * Create a farm operation data ingestion job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     authProviderId: String (Required)
-     *     operations (Optional): [
-     *         String (Optional)
-     *     ]
-     *     startYear: int (Required)
-     *     isIncremental: Boolean (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     authProviderId: String (Required)
-     *     operations (Optional): [
-     *         String (Optional)
-     *     ]
-     *     startYear: int (Required)
-     *     isIncremental: Boolean (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Job Id supplied by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of farm operation data ingestion job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateDataIngestionJob(String jobId, BinaryData job, - RequestOptions requestOptions) { - return this.client.beginCreateDataIngestionJob(jobId, job, requestOptions).getSyncPoller(); - } - - /** - * Get a farm operation data ingestion job. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     authProviderId: String (Required)
-     *     operations (Optional): [
-     *         String (Optional)
-     *     ]
-     *     startYear: int (Required)
-     *     isIncremental: Boolean (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a farm operation data ingestion job along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDataIngestionJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return this.client.getDataIngestionJobDetailsWithResponse(jobId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FarmOperationsClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FarmOperationsClientBuilder.java deleted file mode 100644 index 8a66caadd555..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FarmOperationsClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the FarmOperationsClient type. */ -@ServiceClientBuilder(serviceClients = { FarmOperationsClient.class, FarmOperationsAsyncClient.class }) -public final class FarmOperationsClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the FarmOperationsClientBuilder. */ - @Generated - public FarmOperationsClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public FarmOperationsClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public FarmOperationsClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public FarmOperationsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public FarmOperationsClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public FarmOperationsClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public FarmOperationsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public FarmOperationsClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public FarmOperationsClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public FarmOperationsClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the FarmOperationsClientBuilder. - */ - @Generated - public FarmOperationsClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the FarmOperationsClientBuilder. - */ - @Generated - public FarmOperationsClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of FarmOperationsAsyncClient class. - * - * @return an instance of FarmOperationsAsyncClient. - */ - @Generated - public FarmOperationsAsyncClient buildAsyncClient() { - return new FarmOperationsAsyncClient(buildInnerClient().getFarmOperations()); - } - - /** - * Builds an instance of FarmOperationsClient class. - * - * @return an instance of FarmOperationsClient. - */ - @Generated - public FarmOperationsClient buildClient() { - return new FarmOperationsClient(new FarmOperationsAsyncClient(buildInnerClient().getFarmOperations())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FarmsAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FarmsAsyncClient.java deleted file mode 100644 index 7b193aecbb67..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FarmsAsyncClient.java +++ /dev/null @@ -1,354 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollerFlux; -import com.azure.verticals.agrifood.farming.implementation.FarmsImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = FarmsClientBuilder.class, isAsync = true) -public final class FarmsAsyncClient { - @Generated - private final FarmsImpl serviceClient; - - /** - * Initializes an instance of FarmsAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - FarmsAsyncClient(FarmsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of farm resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(RequestOptions requestOptions) { - return this.serviceClient.listAsync(requestOptions); - } - - /** - * Create a cascade delete job for specified farm. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param farmId ID of the farm to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJob(String jobId, String partyId, String farmId, - RequestOptions requestOptions) { - return this.serviceClient.beginCreateCascadeDeleteJobAsync(jobId, partyId, farmId, requestOptions); - } - - /** - * Get a cascade delete job for specified farm. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified farm along with {@link Response} on successful completion of {@link - * Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponse(String jobId, - RequestOptions requestOptions) { - return this.serviceClient.getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions); - } - - /** - * Returns a paginated list of farm resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyId(String partyId, RequestOptions requestOptions) { - return this.serviceClient.listByPartyIdAsync(partyId, requestOptions); - } - - /** - * Gets a specified farm resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party resource. - * @param farmId ID of the farm resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified farm resource under a particular party along with {@link Response} on successful completion - * of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String partyId, String farmId, RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(partyId, farmId, requestOptions); - } - - /** - * Creates or updates a farm resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party resource. - * @param farmId Id of the farm resource. - * @param farm Farm resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of farm resource along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String partyId, String farmId, BinaryData farm, - RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(partyId, farmId, farm, requestOptions); - } - - /** - * Deletes a specified farm resource under a particular party. - * - * @param partyId Id of the party. - * @param farmId Id of the farm. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String partyId, String farmId, RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(partyId, farmId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FarmsClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FarmsClient.java deleted file mode 100644 index f7c75c095d91..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FarmsClient.java +++ /dev/null @@ -1,349 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.SyncPoller; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = FarmsClientBuilder.class) -public final class FarmsClient { - @Generated - private final FarmsAsyncClient client; - - /** - * Initializes an instance of FarmsClient class. - * - * @param client the async client. - */ - @Generated - FarmsClient(FarmsAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of farm resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(requestOptions)); - } - - /** - * Create a cascade delete job for specified farm. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param farmId ID of the farm to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, String farmId, - RequestOptions requestOptions) { - return this.client.beginCreateCascadeDeleteJob(jobId, partyId, farmId, requestOptions).getSyncPoller(); - } - - /** - * Get a cascade delete job for specified farm. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified farm along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return this.client.getCascadeDeleteJobDetailsWithResponse(jobId, requestOptions).block(); - } - - /** - * Returns a paginated list of farm resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listByPartyId(partyId, requestOptions)); - } - - /** - * Gets a specified farm resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party resource. - * @param farmId ID of the farm resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified farm resource under a particular party along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String farmId, RequestOptions requestOptions) { - return this.client.getWithResponse(partyId, farmId, requestOptions).block(); - } - - /** - * Creates or updates a farm resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party resource. - * @param farmId Id of the farm resource. - * @param farm Farm resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of farm resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String farmId, BinaryData farm, - RequestOptions requestOptions) { - return this.client.createOrUpdateWithResponse(partyId, farmId, farm, requestOptions).block(); - } - - /** - * Deletes a specified farm resource under a particular party. - * - * @param partyId Id of the party. - * @param farmId Id of the farm. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String farmId, RequestOptions requestOptions) { - return this.client.deleteWithResponse(partyId, farmId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FarmsClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FarmsClientBuilder.java deleted file mode 100644 index 898d53a14f44..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FarmsClientBuilder.java +++ /dev/null @@ -1,301 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the FarmsClient type. */ -@ServiceClientBuilder(serviceClients = { FarmsClient.class, FarmsAsyncClient.class }) -public final class FarmsClientBuilder implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the FarmsClientBuilder. */ - @Generated - public FarmsClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public FarmsClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public FarmsClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public FarmsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public FarmsClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public FarmsClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public FarmsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public FarmsClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public FarmsClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public FarmsClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the FarmsClientBuilder. - */ - @Generated - public FarmsClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the FarmsClientBuilder. - */ - @Generated - public FarmsClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of FarmsAsyncClient class. - * - * @return an instance of FarmsAsyncClient. - */ - @Generated - public FarmsAsyncClient buildAsyncClient() { - return new FarmsAsyncClient(buildInnerClient().getFarms()); - } - - /** - * Builds an instance of FarmsClient class. - * - * @return an instance of FarmsClient. - */ - @Generated - public FarmsClient buildClient() { - return new FarmsClient(new FarmsAsyncClient(buildInnerClient().getFarms())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FieldsAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FieldsAsyncClient.java deleted file mode 100644 index f01d36175e44..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FieldsAsyncClient.java +++ /dev/null @@ -1,361 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollerFlux; -import com.azure.verticals.agrifood.farming.implementation.FieldsImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = FieldsClientBuilder.class, isAsync = true) -public final class FieldsAsyncClient { - @Generated - private final FieldsImpl serviceClient; - - /** - * Initializes an instance of FieldsAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - FieldsAsyncClient(FieldsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of field resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
farmIdsList<String>NoFarm Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     farmId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(RequestOptions requestOptions) { - return this.serviceClient.listAsync(requestOptions); - } - - /** - * Get a cascade delete job for specified field. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified field along with {@link Response} on successful completion of {@link - * Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponse(String jobId, - RequestOptions requestOptions) { - return this.serviceClient.getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions); - } - - /** - * Create a cascade delete job for specified field. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param fieldId ID of the field to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJob(String jobId, String partyId, String fieldId, - RequestOptions requestOptions) { - return this.serviceClient.beginCreateCascadeDeleteJobAsync(jobId, partyId, fieldId, requestOptions); - } - - /** - * Returns a paginated list of field resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
farmIdsList<String>NoFarm Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     farmId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyId(String partyId, RequestOptions requestOptions) { - return this.serviceClient.listByPartyIdAsync(partyId, requestOptions); - } - - /** - * Gets a specified field resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     farmId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param fieldId Id of the field. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified field resource under a particular party along with {@link Response} on successful completion - * of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String partyId, String fieldId, RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(partyId, fieldId, requestOptions); - } - - /** - * Creates or Updates a field resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     farmId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     farmId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party resource. - * @param fieldId Id of the field resource. - * @param field Field resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of field resource along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String partyId, String fieldId, BinaryData field, - RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(partyId, fieldId, field, requestOptions); - } - - /** - * Deletes a specified field resource under a particular party. - * - * @param partyId Id of the party. - * @param fieldId Id of the field. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String partyId, String fieldId, RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(partyId, fieldId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FieldsClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FieldsClient.java deleted file mode 100644 index 8916aba025d8..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FieldsClient.java +++ /dev/null @@ -1,356 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.SyncPoller; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = FieldsClientBuilder.class) -public final class FieldsClient { - @Generated - private final FieldsAsyncClient client; - - /** - * Initializes an instance of FieldsClient class. - * - * @param client the async client. - */ - @Generated - FieldsClient(FieldsAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of field resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
farmIdsList<String>NoFarm Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     farmId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(requestOptions)); - } - - /** - * Get a cascade delete job for specified field. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified field along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return this.client.getCascadeDeleteJobDetailsWithResponse(jobId, requestOptions).block(); - } - - /** - * Create a cascade delete job for specified field. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param fieldId ID of the field to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, String fieldId, - RequestOptions requestOptions) { - return this.client.beginCreateCascadeDeleteJob(jobId, partyId, fieldId, requestOptions).getSyncPoller(); - } - - /** - * Returns a paginated list of field resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
farmIdsList<String>NoFarm Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     farmId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listByPartyId(partyId, requestOptions)); - } - - /** - * Gets a specified field resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     farmId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param fieldId Id of the field. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified field resource under a particular party along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String fieldId, RequestOptions requestOptions) { - return this.client.getWithResponse(partyId, fieldId, requestOptions).block(); - } - - /** - * Creates or Updates a field resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     farmId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     farmId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party resource. - * @param fieldId Id of the field resource. - * @param field Field resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of field resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String fieldId, BinaryData field, - RequestOptions requestOptions) { - return this.client.createOrUpdateWithResponse(partyId, fieldId, field, requestOptions).block(); - } - - /** - * Deletes a specified field resource under a particular party. - * - * @param partyId Id of the party. - * @param fieldId Id of the field. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String fieldId, RequestOptions requestOptions) { - return this.client.deleteWithResponse(partyId, fieldId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FieldsClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FieldsClientBuilder.java deleted file mode 100644 index df71a34afe33..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/FieldsClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the FieldsClient type. */ -@ServiceClientBuilder(serviceClients = { FieldsClient.class, FieldsAsyncClient.class }) -public final class FieldsClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the FieldsClientBuilder. */ - @Generated - public FieldsClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public FieldsClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public FieldsClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public FieldsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public FieldsClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public FieldsClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public FieldsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public FieldsClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public FieldsClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public FieldsClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the FieldsClientBuilder. - */ - @Generated - public FieldsClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the FieldsClientBuilder. - */ - @Generated - public FieldsClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of FieldsAsyncClient class. - * - * @return an instance of FieldsAsyncClient. - */ - @Generated - public FieldsAsyncClient buildAsyncClient() { - return new FieldsAsyncClient(buildInnerClient().getFields()); - } - - /** - * Builds an instance of FieldsClient class. - * - * @return an instance of FieldsClient. - */ - @Generated - public FieldsClient buildClient() { - return new FieldsClient(new FieldsAsyncClient(buildInnerClient().getFields())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/HarvestDataAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/HarvestDataAsyncClient.java deleted file mode 100644 index af7e3555009e..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/HarvestDataAsyncClient.java +++ /dev/null @@ -1,530 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollerFlux; -import com.azure.verticals.agrifood.farming.implementation.HarvestDatasImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = HarvestDataClientBuilder.class, isAsync = true) -public final class HarvestDataAsyncClient { - @Generated - private final HarvestDatasImpl serviceClient; - - /** - * Initializes an instance of HarvestDataAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - HarvestDataAsyncClient(HarvestDatasImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of harvest data resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minTotalYieldDoubleNoMinimum Yield value(inclusive).
maxTotalYieldDoubleNoMaximum Yield value (inclusive).
minAvgYieldDoubleNoMinimum AvgYield value(inclusive).
maxAvgYieldDoubleNoMaximum AvgYield value (inclusive).
minTotalWetMassDoubleNoMinimum Total WetMass value(inclusive).
maxTotalWetMassDoubleNoMaximum Total WetMass value (inclusive).
minAvgWetMassDoubleNoMinimum AvgWetMass value(inclusive).
maxAvgWetMassDoubleNoMaximum AvgWetMass value (inclusive).
minAvgMoistureDoubleNoMinimum AvgMoisture value(inclusive).
maxAvgMoistureDoubleNoMaximum AvgMoisture value (inclusive).
minAvgSpeedDoubleNoMinimum AvgSpeed value(inclusive).
maxAvgSpeedDoubleNoMaximum AvgSpeed value (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     totalYield (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     avgYield (Optional): (recursive schema, see avgYield above)
-     *     totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *     avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *     avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *     avgSpeed (Optional): (recursive schema, see avgSpeed above)
-     *     harvestProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalYield (Optional): (recursive schema, see totalYield above)
-     *             avgYield (Optional): (recursive schema, see avgYield above)
-     *             avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *             totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *             avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(RequestOptions requestOptions) { - return this.serviceClient.listAsync(requestOptions); - } - - /** - * Create cascade delete job for harvest data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param partyId Id of the party. - * @param harvestDataId Id of the harvest data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJob(String jobId, String partyId, - String harvestDataId, RequestOptions requestOptions) { - return this.serviceClient.beginCreateCascadeDeleteJobAsync(jobId, partyId, harvestDataId, requestOptions); - } - - /** - * Get cascade delete job for harvest data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for harvest data resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponse(String jobId, - RequestOptions requestOptions) { - return this.serviceClient.getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions); - } - - /** - * Returns a paginated list of harvest data resources under a particular farm. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minTotalYieldDoubleNoMinimum Yield value(inclusive).
maxTotalYieldDoubleNoMaximum Yield value (inclusive).
minAvgYieldDoubleNoMinimum AvgYield value(inclusive).
maxAvgYieldDoubleNoMaximum AvgYield value (inclusive).
minTotalWetMassDoubleNoMinimum Total WetMass value(inclusive).
maxTotalWetMassDoubleNoMaximum Total WetMass value (inclusive).
minAvgWetMassDoubleNoMinimum AvgWetMass value(inclusive).
maxAvgWetMassDoubleNoMaximum AvgWetMass value (inclusive).
minAvgMoistureDoubleNoMinimum AvgMoisture value(inclusive).
maxAvgMoistureDoubleNoMaximum AvgMoisture value (inclusive).
minAvgSpeedDoubleNoMinimum AvgSpeed value(inclusive).
maxAvgSpeedDoubleNoMaximum AvgSpeed value (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     totalYield (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     avgYield (Optional): (recursive schema, see avgYield above)
-     *     totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *     avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *     avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *     avgSpeed (Optional): (recursive schema, see avgSpeed above)
-     *     harvestProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalYield (Optional): (recursive schema, see totalYield above)
-     *             avgYield (Optional): (recursive schema, see avgYield above)
-     *             avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *             totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *             avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyId(String partyId, RequestOptions requestOptions) { - return this.serviceClient.listByPartyIdAsync(partyId, requestOptions); - } - - /** - * Get a specified harvest data resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     totalYield (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     avgYield (Optional): (recursive schema, see avgYield above)
-     *     totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *     avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *     avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *     avgSpeed (Optional): (recursive schema, see avgSpeed above)
-     *     harvestProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalYield (Optional): (recursive schema, see totalYield above)
-     *             avgYield (Optional): (recursive schema, see avgYield above)
-     *             avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *             totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *             avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party resource. - * @param harvestDataId ID of the harvest data resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified harvest data resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String partyId, String harvestDataId, - RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(partyId, harvestDataId, requestOptions); - } - - /** - * Creates or updates harvest data resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     totalYield (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     avgYield (Optional): (recursive schema, see avgYield above)
-     *     totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *     avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *     avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *     avgSpeed (Optional): (recursive schema, see avgSpeed above)
-     *     harvestProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalYield (Optional): (recursive schema, see totalYield above)
-     *             avgYield (Optional): (recursive schema, see avgYield above)
-     *             avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *             totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *             avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     totalYield (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     avgYield (Optional): (recursive schema, see avgYield above)
-     *     totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *     avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *     avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *     avgSpeed (Optional): (recursive schema, see avgSpeed above)
-     *     harvestProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalYield (Optional): (recursive schema, see totalYield above)
-     *             avgYield (Optional): (recursive schema, see avgYield above)
-     *             avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *             totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *             avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the party. - * @param harvestDataId ID of the harvest data resource. - * @param harvestData Harvest data resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of harvest data resource along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String partyId, String harvestDataId, - BinaryData harvestData, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(partyId, harvestDataId, harvestData, requestOptions); - } - - /** - * Deletes a specified harvest data resource under a particular party. - * - * @param partyId ID of the associated party resource. - * @param harvestDataId ID of the harvest data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String partyId, String harvestDataId, - RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(partyId, harvestDataId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/HarvestDataClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/HarvestDataClient.java deleted file mode 100644 index 22bbbe3bf398..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/HarvestDataClient.java +++ /dev/null @@ -1,523 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.SyncPoller; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = HarvestDataClientBuilder.class) -public final class HarvestDataClient { - @Generated - private final HarvestDataAsyncClient client; - - /** - * Initializes an instance of HarvestDataClient class. - * - * @param client the async client. - */ - @Generated - HarvestDataClient(HarvestDataAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of harvest data resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minTotalYieldDoubleNoMinimum Yield value(inclusive).
maxTotalYieldDoubleNoMaximum Yield value (inclusive).
minAvgYieldDoubleNoMinimum AvgYield value(inclusive).
maxAvgYieldDoubleNoMaximum AvgYield value (inclusive).
minTotalWetMassDoubleNoMinimum Total WetMass value(inclusive).
maxTotalWetMassDoubleNoMaximum Total WetMass value (inclusive).
minAvgWetMassDoubleNoMinimum AvgWetMass value(inclusive).
maxAvgWetMassDoubleNoMaximum AvgWetMass value (inclusive).
minAvgMoistureDoubleNoMinimum AvgMoisture value(inclusive).
maxAvgMoistureDoubleNoMaximum AvgMoisture value (inclusive).
minAvgSpeedDoubleNoMinimum AvgSpeed value(inclusive).
maxAvgSpeedDoubleNoMaximum AvgSpeed value (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     totalYield (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     avgYield (Optional): (recursive schema, see avgYield above)
-     *     totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *     avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *     avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *     avgSpeed (Optional): (recursive schema, see avgSpeed above)
-     *     harvestProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalYield (Optional): (recursive schema, see totalYield above)
-     *             avgYield (Optional): (recursive schema, see avgYield above)
-     *             avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *             totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *             avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(requestOptions)); - } - - /** - * Create cascade delete job for harvest data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param partyId Id of the party. - * @param harvestDataId Id of the harvest data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, - String harvestDataId, RequestOptions requestOptions) { - return this.client.beginCreateCascadeDeleteJob(jobId, partyId, harvestDataId, requestOptions).getSyncPoller(); - } - - /** - * Get cascade delete job for harvest data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for harvest data resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return this.client.getCascadeDeleteJobDetailsWithResponse(jobId, requestOptions).block(); - } - - /** - * Returns a paginated list of harvest data resources under a particular farm. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minTotalYieldDoubleNoMinimum Yield value(inclusive).
maxTotalYieldDoubleNoMaximum Yield value (inclusive).
minAvgYieldDoubleNoMinimum AvgYield value(inclusive).
maxAvgYieldDoubleNoMaximum AvgYield value (inclusive).
minTotalWetMassDoubleNoMinimum Total WetMass value(inclusive).
maxTotalWetMassDoubleNoMaximum Total WetMass value (inclusive).
minAvgWetMassDoubleNoMinimum AvgWetMass value(inclusive).
maxAvgWetMassDoubleNoMaximum AvgWetMass value (inclusive).
minAvgMoistureDoubleNoMinimum AvgMoisture value(inclusive).
maxAvgMoistureDoubleNoMaximum AvgMoisture value (inclusive).
minAvgSpeedDoubleNoMinimum AvgSpeed value(inclusive).
maxAvgSpeedDoubleNoMaximum AvgSpeed value (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     totalYield (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     avgYield (Optional): (recursive schema, see avgYield above)
-     *     totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *     avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *     avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *     avgSpeed (Optional): (recursive schema, see avgSpeed above)
-     *     harvestProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalYield (Optional): (recursive schema, see totalYield above)
-     *             avgYield (Optional): (recursive schema, see avgYield above)
-     *             avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *             totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *             avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listByPartyId(partyId, requestOptions)); - } - - /** - * Get a specified harvest data resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     totalYield (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     avgYield (Optional): (recursive schema, see avgYield above)
-     *     totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *     avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *     avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *     avgSpeed (Optional): (recursive schema, see avgSpeed above)
-     *     harvestProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalYield (Optional): (recursive schema, see totalYield above)
-     *             avgYield (Optional): (recursive schema, see avgYield above)
-     *             avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *             totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *             avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party resource. - * @param harvestDataId ID of the harvest data resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified harvest data resource under a particular party along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String harvestDataId, RequestOptions requestOptions) { - return this.client.getWithResponse(partyId, harvestDataId, requestOptions).block(); - } - - /** - * Creates or updates harvest data resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     totalYield (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     avgYield (Optional): (recursive schema, see avgYield above)
-     *     totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *     avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *     avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *     avgSpeed (Optional): (recursive schema, see avgSpeed above)
-     *     harvestProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalYield (Optional): (recursive schema, see totalYield above)
-     *             avgYield (Optional): (recursive schema, see avgYield above)
-     *             avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *             totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *             avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     totalYield (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     avgYield (Optional): (recursive schema, see avgYield above)
-     *     totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *     avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *     avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *     avgSpeed (Optional): (recursive schema, see avgSpeed above)
-     *     harvestProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalYield (Optional): (recursive schema, see totalYield above)
-     *             avgYield (Optional): (recursive schema, see avgYield above)
-     *             avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *             totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *             avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the party. - * @param harvestDataId ID of the harvest data resource. - * @param harvestData Harvest data resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of harvest data resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String harvestDataId, BinaryData harvestData, - RequestOptions requestOptions) { - return this.client.createOrUpdateWithResponse(partyId, harvestDataId, harvestData, requestOptions).block(); - } - - /** - * Deletes a specified harvest data resource under a particular party. - * - * @param partyId ID of the associated party resource. - * @param harvestDataId ID of the harvest data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String harvestDataId, RequestOptions requestOptions) { - return this.client.deleteWithResponse(partyId, harvestDataId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/HarvestDataClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/HarvestDataClientBuilder.java deleted file mode 100644 index 4b70b933b839..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/HarvestDataClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the HarvestDataClient type. */ -@ServiceClientBuilder(serviceClients = { HarvestDataClient.class, HarvestDataAsyncClient.class }) -public final class HarvestDataClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the HarvestDataClientBuilder. */ - @Generated - public HarvestDataClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public HarvestDataClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public HarvestDataClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public HarvestDataClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public HarvestDataClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public HarvestDataClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public HarvestDataClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public HarvestDataClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public HarvestDataClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public HarvestDataClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the HarvestDataClientBuilder. - */ - @Generated - public HarvestDataClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the HarvestDataClientBuilder. - */ - @Generated - public HarvestDataClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of HarvestDataAsyncClient class. - * - * @return an instance of HarvestDataAsyncClient. - */ - @Generated - public HarvestDataAsyncClient buildAsyncClient() { - return new HarvestDataAsyncClient(buildInnerClient().getHarvestDatas()); - } - - /** - * Builds an instance of HarvestDataClient class. - * - * @return an instance of HarvestDataClient. - */ - @Generated - public HarvestDataClient buildClient() { - return new HarvestDataClient(new HarvestDataAsyncClient(buildInnerClient().getHarvestDatas())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ImageProcessingAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ImageProcessingAsyncClient.java deleted file mode 100644 index 015e6b23d21f..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ImageProcessingAsyncClient.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollerFlux; -import com.azure.verticals.agrifood.farming.implementation.ImageProcessingsImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = ImageProcessingClientBuilder.class, isAsync = true) -public final class ImageProcessingAsyncClient { - @Generated - private final ImageProcessingsImpl serviceClient; - - /** - * Initializes an instance of ImageProcessingAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - ImageProcessingAsyncClient(ImageProcessingsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Create a ImageProcessing Rasterize job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     shapefileAttachmentId: String (Required)
-     *     shapefileColumnNames (Required): [
-     *         String (Required)
-     *     ]
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     shapefileAttachmentId: String (Required)
-     *     shapefileColumnNames (Required): [
-     *         String (Required)
-     *     ]
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId JobId provided by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of image Processing Rasterize Job to convert shapefile into tiff file. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateRasterizeJob(String jobId, BinaryData job, - RequestOptions requestOptions) { - return this.serviceClient.beginCreateRasterizeJobAsync(jobId, job, requestOptions); - } - - /** - * Get ImageProcessing Rasterize job's details. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     shapefileAttachmentId: String (Required)
-     *     shapefileColumnNames (Required): [
-     *         String (Required)
-     *     ]
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return imageProcessing Rasterize job's details along with {@link Response} on successful completion of {@link - * Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRasterizeJobWithResponse(String jobId, RequestOptions requestOptions) { - return this.serviceClient.getRasterizeJobWithResponseAsync(jobId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ImageProcessingClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ImageProcessingClient.java deleted file mode 100644 index 9c70c5125431..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ImageProcessingClient.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.SyncPoller; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = ImageProcessingClientBuilder.class) -public final class ImageProcessingClient { - @Generated - private final ImageProcessingAsyncClient client; - - /** - * Initializes an instance of ImageProcessingClient class. - * - * @param client the async client. - */ - @Generated - ImageProcessingClient(ImageProcessingAsyncClient client) { - this.client = client; - } - - /** - * Create a ImageProcessing Rasterize job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     shapefileAttachmentId: String (Required)
-     *     shapefileColumnNames (Required): [
-     *         String (Required)
-     *     ]
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     shapefileAttachmentId: String (Required)
-     *     shapefileColumnNames (Required): [
-     *         String (Required)
-     *     ]
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId JobId provided by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of image Processing Rasterize Job to convert shapefile into tiff file. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateRasterizeJob(String jobId, BinaryData job, - RequestOptions requestOptions) { - return this.client.beginCreateRasterizeJob(jobId, job, requestOptions).getSyncPoller(); - } - - /** - * Get ImageProcessing Rasterize job's details. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     shapefileAttachmentId: String (Required)
-     *     shapefileColumnNames (Required): [
-     *         String (Required)
-     *     ]
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return imageProcessing Rasterize job's details along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getRasterizeJobWithResponse(String jobId, RequestOptions requestOptions) { - return this.client.getRasterizeJobWithResponse(jobId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ImageProcessingClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ImageProcessingClientBuilder.java deleted file mode 100644 index 3c426a321dd6..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ImageProcessingClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the ImageProcessingClient type. */ -@ServiceClientBuilder(serviceClients = { ImageProcessingClient.class, ImageProcessingAsyncClient.class }) -public final class ImageProcessingClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the ImageProcessingClientBuilder. */ - @Generated - public ImageProcessingClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public ImageProcessingClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public ImageProcessingClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public ImageProcessingClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public ImageProcessingClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public ImageProcessingClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public ImageProcessingClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public ImageProcessingClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public ImageProcessingClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public ImageProcessingClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the ImageProcessingClientBuilder. - */ - @Generated - public ImageProcessingClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the ImageProcessingClientBuilder. - */ - @Generated - public ImageProcessingClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of ImageProcessingAsyncClient class. - * - * @return an instance of ImageProcessingAsyncClient. - */ - @Generated - public ImageProcessingAsyncClient buildAsyncClient() { - return new ImageProcessingAsyncClient(buildInnerClient().getImageProcessings()); - } - - /** - * Builds an instance of ImageProcessingClient class. - * - * @return an instance of ImageProcessingClient. - */ - @Generated - public ImageProcessingClient buildClient() { - return new ImageProcessingClient(new ImageProcessingAsyncClient(buildInnerClient().getImageProcessings())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/InsightAttachmentsAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/InsightAttachmentsAsyncClient.java deleted file mode 100644 index 56cd3a2a3a36..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/InsightAttachmentsAsyncClient.java +++ /dev/null @@ -1,272 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.verticals.agrifood.farming.implementation.InsightAttachmentsImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = InsightAttachmentsClientBuilder.class, isAsync = true) -public final class InsightAttachmentsAsyncClient { - @Generated - private final InsightAttachmentsImpl serviceClient; - - /** - * Initializes an instance of InsightAttachmentsAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - InsightAttachmentsAsyncClient(InsightAttachmentsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of insight resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
insightIdsList<String>NoList of insight IDs. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     insightId: String (Required)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyIdModelIdAndResource(String partyId, String modelId, String resourceType, - String resourceId, RequestOptions requestOptions) { - return this.serviceClient.listByPartyIdModelIdAndResourceAsync(partyId, modelId, resourceType, resourceId, - requestOptions); - } - - /** - * Creates or updates insight entity. - * - *

Header Parameters - * - * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: "multipart/form-data".
- * - * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Request Body Schema - * - *

{@code
-     * BinaryData
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     insightId: String (Required)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightAttachmentId Id of the insight resource. - * @param insightId InsightID for this InsightAttachment. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of insight attachment resource along with {@link Response} on successful completion of {@link - * Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String partyId, String modelId, String resourceType, - String resourceId, String insightAttachmentId, BinaryData insightId, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(partyId, modelId, resourceType, resourceId, - insightAttachmentId, insightId, requestOptions); - } - - /** - * Gets a specified insight resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     insightId: String (Required)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightAttachmentId Id of the insight attachment resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified insight resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String partyId, String modelId, String resourceType, - String resourceId, String insightAttachmentId, RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(partyId, modelId, resourceType, resourceId, insightAttachmentId, - requestOptions); - } - - /** - * Deletes a specified insight resource. - * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightAttachmentId Id of the insight attachment resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String partyId, String modelId, String resourceType, - String resourceId, String insightAttachmentId, RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(partyId, modelId, resourceType, resourceId, - insightAttachmentId, requestOptions); - } - - /** - * Downloads and returns insight-attachment as response for the given input filePath. - * - *

Response Body Schema - * - *

{@code
-     * BinaryData
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightAttachmentId Id of the insight attachment resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> downloadWithResponse(String partyId, String modelId, String resourceType, - String resourceId, String insightAttachmentId, RequestOptions requestOptions) { - return this.serviceClient.downloadWithResponseAsync(partyId, modelId, resourceType, resourceId, - insightAttachmentId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/InsightAttachmentsClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/InsightAttachmentsClient.java deleted file mode 100644 index f229f0d96032..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/InsightAttachmentsClient.java +++ /dev/null @@ -1,273 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = InsightAttachmentsClientBuilder.class) -public final class InsightAttachmentsClient { - @Generated - private final InsightAttachmentsAsyncClient client; - - /** - * Initializes an instance of InsightAttachmentsClient class. - * - * @param client the async client. - */ - @Generated - InsightAttachmentsClient(InsightAttachmentsAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of insight resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
insightIdsList<String>NoList of insight IDs. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     insightId: String (Required)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyIdModelIdAndResource(String partyId, String modelId, - String resourceType, String resourceId, RequestOptions requestOptions) { - return new PagedIterable<>( - this.client.listByPartyIdModelIdAndResource(partyId, modelId, resourceType, resourceId, requestOptions)); - } - - /** - * Creates or updates insight entity. - * - *

Header Parameters - * - * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: "multipart/form-data".
- * - * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Request Body Schema - * - *

{@code
-     * BinaryData
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     insightId: String (Required)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightAttachmentId Id of the insight resource. - * @param insightId InsightID for this InsightAttachment. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of insight attachment resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String modelId, String resourceType, - String resourceId, String insightAttachmentId, BinaryData insightId, RequestOptions requestOptions) { - return this.client - .createOrUpdateWithResponse(partyId, modelId, resourceType, resourceId, insightAttachmentId, insightId, - requestOptions) - .block(); - } - - /** - * Gets a specified insight resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     insightId: String (Required)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightAttachmentId Id of the insight attachment resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified insight resource under a particular party along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String modelId, String resourceType, String resourceId, - String insightAttachmentId, RequestOptions requestOptions) { - return this.client - .getWithResponse(partyId, modelId, resourceType, resourceId, insightAttachmentId, requestOptions) - .block(); - } - - /** - * Deletes a specified insight resource. - * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightAttachmentId Id of the insight attachment resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String modelId, String resourceType, String resourceId, - String insightAttachmentId, RequestOptions requestOptions) { - return this.client - .deleteWithResponse(partyId, modelId, resourceType, resourceId, insightAttachmentId, requestOptions) - .block(); - } - - /** - * Downloads and returns insight-attachment as response for the given input filePath. - * - *

Response Body Schema - * - *

{@code
-     * BinaryData
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightAttachmentId Id of the insight attachment resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response downloadWithResponse(String partyId, String modelId, String resourceType, - String resourceId, String insightAttachmentId, RequestOptions requestOptions) { - return this.client - .downloadWithResponse(partyId, modelId, resourceType, resourceId, insightAttachmentId, requestOptions) - .block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/InsightAttachmentsClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/InsightAttachmentsClientBuilder.java deleted file mode 100644 index eebf910e83c7..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/InsightAttachmentsClientBuilder.java +++ /dev/null @@ -1,303 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the InsightAttachmentsClient type. */ -@ServiceClientBuilder(serviceClients = { InsightAttachmentsClient.class, InsightAttachmentsAsyncClient.class }) -public final class InsightAttachmentsClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the InsightAttachmentsClientBuilder. */ - @Generated - public InsightAttachmentsClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public InsightAttachmentsClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public InsightAttachmentsClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public InsightAttachmentsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public InsightAttachmentsClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public InsightAttachmentsClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public InsightAttachmentsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public InsightAttachmentsClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public InsightAttachmentsClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public InsightAttachmentsClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the InsightAttachmentsClientBuilder. - */ - @Generated - public InsightAttachmentsClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the InsightAttachmentsClientBuilder. - */ - @Generated - public InsightAttachmentsClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of InsightAttachmentsAsyncClient class. - * - * @return an instance of InsightAttachmentsAsyncClient. - */ - @Generated - public InsightAttachmentsAsyncClient buildAsyncClient() { - return new InsightAttachmentsAsyncClient(buildInnerClient().getInsightAttachments()); - } - - /** - * Builds an instance of InsightAttachmentsClient class. - * - * @return an instance of InsightAttachmentsClient. - */ - @Generated - public InsightAttachmentsClient buildClient() { - return new InsightAttachmentsClient( - new InsightAttachmentsAsyncClient(buildInnerClient().getInsightAttachments())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/InsightsAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/InsightsAsyncClient.java deleted file mode 100644 index b620efc448cc..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/InsightsAsyncClient.java +++ /dev/null @@ -1,376 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollerFlux; -import com.azure.verticals.agrifood.farming.implementation.InsightsImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = InsightsClientBuilder.class, isAsync = true) -public final class InsightsAsyncClient { - @Generated - private final InsightsImpl serviceClient; - - /** - * Initializes an instance of InsightsAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - InsightsAsyncClient(InsightsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Create a cascade delete job for insights specified partyId/modelId/resourceType/resourceId. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param modelId Id of the associated model. - * @param resourceType Resource Type. - * @param resourceId Id of the associated resource. - * @param insightId Insight id. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJob(String jobId, String partyId, String modelId, - String resourceType, String resourceId, String insightId, RequestOptions requestOptions) { - return this.serviceClient.beginCreateCascadeDeleteJobAsync(jobId, partyId, modelId, resourceType, resourceId, - insightId, requestOptions); - } - - /** - * Get a cascade delete job for specified insight. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified insight along with {@link Response} on successful completion of {@link - * Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponse(String jobId, - RequestOptions requestOptions) { - return this.serviceClient.getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions); - } - - /** - * Returns a paginated list of insight resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minInsightStartDateTimeOffsetDateTimeNoMinimum insightStartDateTime time of insight resources (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
maxInsightStartDateTimeOffsetDateTimeNoMaximum insightStartDateTime time of insight resources (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
minInsightEndDateTimeOffsetDateTimeNoMinimum insightEndDateTime time of insight resources (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
maxInsightEndDateTimeOffsetDateTimeNoMaximum insightEndDateTime time of insight resources (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
measurementFiltersList<String>NoFilters on measureKey.unit/unitValue or measureKey.value/value pairs within the Measures object. - * eg. "measureKey.unit eq {testValue}" where testValue is string. - * eg. "measureKey.value eq {testValue}" where testValue = double. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     modelVersion: String (Optional)
-     *     attachmentsLink: String (Optional)
-     *     insightStartDateTime: OffsetDateTime (Optional)
-     *     insightEndDateTime: OffsetDateTime (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyIdModelIdAndResource(String partyId, String modelId, String resourceType, - String resourceId, RequestOptions requestOptions) { - return this.serviceClient.listByPartyIdModelIdAndResourceAsync(partyId, modelId, resourceType, resourceId, - requestOptions); - } - - /** - * Creates or updates insight entity. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     modelVersion: String (Optional)
-     *     attachmentsLink: String (Optional)
-     *     insightStartDateTime: OffsetDateTime (Optional)
-     *     insightEndDateTime: OffsetDateTime (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     modelVersion: String (Optional)
-     *     attachmentsLink: String (Optional)
-     *     insightStartDateTime: OffsetDateTime (Optional)
-     *     insightEndDateTime: OffsetDateTime (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightId Id of the insight resource. - * @param insightData Insight data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of insight resource along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String partyId, String modelId, String resourceType, - String resourceId, String insightId, BinaryData insightData, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(partyId, modelId, resourceType, resourceId, insightId, - insightData, requestOptions); - } - - /** - * Gets a specified insight resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     modelVersion: String (Optional)
-     *     attachmentsLink: String (Optional)
-     *     insightStartDateTime: OffsetDateTime (Optional)
-     *     insightEndDateTime: OffsetDateTime (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightId Id of the insight resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified insight resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String partyId, String modelId, String resourceType, - String resourceId, String insightId, RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(partyId, modelId, resourceType, resourceId, insightId, - requestOptions); - } - - /** - * Deletes a specified insight resource. - * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightId Id of the insight resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String partyId, String modelId, String resourceType, - String resourceId, String insightId, RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(partyId, modelId, resourceType, resourceId, insightId, - requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/InsightsClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/InsightsClient.java deleted file mode 100644 index 30c79ee20ac5..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/InsightsClient.java +++ /dev/null @@ -1,374 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.SyncPoller; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = InsightsClientBuilder.class) -public final class InsightsClient { - @Generated - private final InsightsAsyncClient client; - - /** - * Initializes an instance of InsightsClient class. - * - * @param client the async client. - */ - @Generated - InsightsClient(InsightsAsyncClient client) { - this.client = client; - } - - /** - * Create a cascade delete job for insights specified partyId/modelId/resourceType/resourceId. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param modelId Id of the associated model. - * @param resourceType Resource Type. - * @param resourceId Id of the associated resource. - * @param insightId Insight id. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, String modelId, - String resourceType, String resourceId, String insightId, RequestOptions requestOptions) { - return this.client - .beginCreateCascadeDeleteJob(jobId, partyId, modelId, resourceType, resourceId, insightId, requestOptions) - .getSyncPoller(); - } - - /** - * Get a cascade delete job for specified insight. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified insight along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return this.client.getCascadeDeleteJobDetailsWithResponse(jobId, requestOptions).block(); - } - - /** - * Returns a paginated list of insight resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minInsightStartDateTimeOffsetDateTimeNoMinimum insightStartDateTime time of insight resources (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
maxInsightStartDateTimeOffsetDateTimeNoMaximum insightStartDateTime time of insight resources (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
minInsightEndDateTimeOffsetDateTimeNoMinimum insightEndDateTime time of insight resources (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
maxInsightEndDateTimeOffsetDateTimeNoMaximum insightEndDateTime time of insight resources (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
measurementFiltersList<String>NoFilters on measureKey.unit/unitValue or measureKey.value/value pairs within the Measures object. - * eg. "measureKey.unit eq {testValue}" where testValue is string. - * eg. "measureKey.value eq {testValue}" where testValue = double. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     modelVersion: String (Optional)
-     *     attachmentsLink: String (Optional)
-     *     insightStartDateTime: OffsetDateTime (Optional)
-     *     insightEndDateTime: OffsetDateTime (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyIdModelIdAndResource(String partyId, String modelId, - String resourceType, String resourceId, RequestOptions requestOptions) { - return new PagedIterable<>( - this.client.listByPartyIdModelIdAndResource(partyId, modelId, resourceType, resourceId, requestOptions)); - } - - /** - * Creates or updates insight entity. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     modelVersion: String (Optional)
-     *     attachmentsLink: String (Optional)
-     *     insightStartDateTime: OffsetDateTime (Optional)
-     *     insightEndDateTime: OffsetDateTime (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     modelVersion: String (Optional)
-     *     attachmentsLink: String (Optional)
-     *     insightStartDateTime: OffsetDateTime (Optional)
-     *     insightEndDateTime: OffsetDateTime (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightId Id of the insight resource. - * @param insightData Insight data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of insight resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String modelId, String resourceType, - String resourceId, String insightId, BinaryData insightData, RequestOptions requestOptions) { - return this.client - .createOrUpdateWithResponse(partyId, modelId, resourceType, resourceId, insightId, insightData, - requestOptions) - .block(); - } - - /** - * Gets a specified insight resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     modelVersion: String (Optional)
-     *     attachmentsLink: String (Optional)
-     *     insightStartDateTime: OffsetDateTime (Optional)
-     *     insightEndDateTime: OffsetDateTime (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightId Id of the insight resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified insight resource under a particular party along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String modelId, String resourceType, String resourceId, - String insightId, RequestOptions requestOptions) { - return this.client.getWithResponse(partyId, modelId, resourceType, resourceId, insightId, requestOptions) - .block(); - } - - /** - * Deletes a specified insight resource. - * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightId Id of the insight resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String modelId, String resourceType, String resourceId, - String insightId, RequestOptions requestOptions) { - return this.client.deleteWithResponse(partyId, modelId, resourceType, resourceId, insightId, requestOptions) - .block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/InsightsClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/InsightsClientBuilder.java deleted file mode 100644 index b823708f549d..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/InsightsClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the InsightsClient type. */ -@ServiceClientBuilder(serviceClients = { InsightsClient.class, InsightsAsyncClient.class }) -public final class InsightsClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the InsightsClientBuilder. */ - @Generated - public InsightsClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public InsightsClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public InsightsClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public InsightsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public InsightsClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public InsightsClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public InsightsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public InsightsClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public InsightsClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public InsightsClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the InsightsClientBuilder. - */ - @Generated - public InsightsClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the InsightsClientBuilder. - */ - @Generated - public InsightsClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of InsightsAsyncClient class. - * - * @return an instance of InsightsAsyncClient. - */ - @Generated - public InsightsAsyncClient buildAsyncClient() { - return new InsightsAsyncClient(buildInnerClient().getInsights()); - } - - /** - * Builds an instance of InsightsClient class. - * - * @return an instance of InsightsClient. - */ - @Generated - public InsightsClient buildClient() { - return new InsightsClient(new InsightsAsyncClient(buildInnerClient().getInsights())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ManagementZonesAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ManagementZonesAsyncClient.java deleted file mode 100644 index f04c2fb0d69a..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ManagementZonesAsyncClient.java +++ /dev/null @@ -1,387 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollerFlux; -import com.azure.verticals.agrifood.farming.implementation.ManagementZonesImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = ManagementZonesClientBuilder.class, isAsync = true) -public final class ManagementZonesAsyncClient { - @Generated - private final ManagementZonesImpl serviceClient; - - /** - * Initializes an instance of ManagementZonesAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - ManagementZonesAsyncClient(ManagementZonesImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of management zone resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCropIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeasonIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoFieldIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(RequestOptions requestOptions) { - return this.serviceClient.listAsync(requestOptions); - } - - /** - * Get a cascade delete job for specified job id. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified job id along with {@link Response} on successful completion of {@link - * Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponse(String jobId, - RequestOptions requestOptions) { - return this.serviceClient.getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions); - } - - /** - * Create a cascade delete job for specified management zone. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param managementZoneId ID of the management zone to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJob(String jobId, String partyId, - String managementZoneId, RequestOptions requestOptions) { - return this.serviceClient.beginCreateCascadeDeleteJobAsync(jobId, partyId, managementZoneId, requestOptions); - } - - /** - * Returns a paginated list of management zone resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCropIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeasonIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoFieldIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyId(String partyId, RequestOptions requestOptions) { - return this.serviceClient.listByPartyIdAsync(partyId, requestOptions); - } - - /** - * Gets a specified management zone resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param managementZoneId Id of the management zone. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified management zone resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String partyId, String managementZoneId, - RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(partyId, managementZoneId, requestOptions); - } - - /** - * Creates or updates a management zone resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party resource. - * @param managementZoneId Id of the management zone resource. - * @param managementZone ManagementZone resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return api Model for ManagementZone object along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String partyId, String managementZoneId, - BinaryData managementZone, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(partyId, managementZoneId, managementZone, - requestOptions); - } - - /** - * Deletes a specified management zone resource under a particular party. - * - * @param partyId Id of the party. - * @param managementZoneId Id of the management zone. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String partyId, String managementZoneId, - RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(partyId, managementZoneId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ManagementZonesClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ManagementZonesClient.java deleted file mode 100644 index b4fe7d5bc968..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ManagementZonesClient.java +++ /dev/null @@ -1,382 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.SyncPoller; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = ManagementZonesClientBuilder.class) -public final class ManagementZonesClient { - @Generated - private final ManagementZonesAsyncClient client; - - /** - * Initializes an instance of ManagementZonesClient class. - * - * @param client the async client. - */ - @Generated - ManagementZonesClient(ManagementZonesAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of management zone resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCropIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeasonIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoFieldIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(requestOptions)); - } - - /** - * Get a cascade delete job for specified job id. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified job id along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return this.client.getCascadeDeleteJobDetailsWithResponse(jobId, requestOptions).block(); - } - - /** - * Create a cascade delete job for specified management zone. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param managementZoneId ID of the management zone to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, - String managementZoneId, RequestOptions requestOptions) { - return this.client.beginCreateCascadeDeleteJob(jobId, partyId, managementZoneId, requestOptions) - .getSyncPoller(); - } - - /** - * Returns a paginated list of management zone resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCropIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeasonIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoFieldIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listByPartyId(partyId, requestOptions)); - } - - /** - * Gets a specified management zone resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param managementZoneId Id of the management zone. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified management zone resource under a particular party along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String managementZoneId, - RequestOptions requestOptions) { - return this.client.getWithResponse(partyId, managementZoneId, requestOptions).block(); - } - - /** - * Creates or updates a management zone resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party resource. - * @param managementZoneId Id of the management zone resource. - * @param managementZone ManagementZone resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return api Model for ManagementZone object along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String managementZoneId, - BinaryData managementZone, RequestOptions requestOptions) { - return this.client.createOrUpdateWithResponse(partyId, managementZoneId, managementZone, requestOptions) - .block(); - } - - /** - * Deletes a specified management zone resource under a particular party. - * - * @param partyId Id of the party. - * @param managementZoneId Id of the management zone. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String managementZoneId, RequestOptions requestOptions) { - return this.client.deleteWithResponse(partyId, managementZoneId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ManagementZonesClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ManagementZonesClientBuilder.java deleted file mode 100644 index 5600ebe78f20..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ManagementZonesClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the ManagementZonesClient type. */ -@ServiceClientBuilder(serviceClients = { ManagementZonesClient.class, ManagementZonesAsyncClient.class }) -public final class ManagementZonesClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the ManagementZonesClientBuilder. */ - @Generated - public ManagementZonesClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public ManagementZonesClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public ManagementZonesClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public ManagementZonesClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public ManagementZonesClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public ManagementZonesClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public ManagementZonesClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public ManagementZonesClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public ManagementZonesClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public ManagementZonesClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the ManagementZonesClientBuilder. - */ - @Generated - public ManagementZonesClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the ManagementZonesClientBuilder. - */ - @Generated - public ManagementZonesClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of ManagementZonesAsyncClient class. - * - * @return an instance of ManagementZonesAsyncClient. - */ - @Generated - public ManagementZonesAsyncClient buildAsyncClient() { - return new ManagementZonesAsyncClient(buildInnerClient().getManagementZones()); - } - - /** - * Builds an instance of ManagementZonesClient class. - * - * @return an instance of ManagementZonesClient. - */ - @Generated - public ManagementZonesClient buildClient() { - return new ManagementZonesClient(new ManagementZonesAsyncClient(buildInnerClient().getManagementZones())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ModelInferenceAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ModelInferenceAsyncClient.java deleted file mode 100644 index b24cb6f5d9a7..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ModelInferenceAsyncClient.java +++ /dev/null @@ -1,462 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollerFlux; -import com.azure.verticals.agrifood.farming.implementation.ModelInferencesImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = ModelInferenceClientBuilder.class, isAsync = true) -public final class ModelInferenceAsyncClient { - @Generated - private final ModelInferencesImpl serviceClient; - - /** - * Initializes an instance of ModelInferenceAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - ModelInferenceAsyncClient(ModelInferencesImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Create a Biomass Model job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     cropName: String(Corn) (Required)
-     *     plantingStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     weatherExtensionId: String (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     cropName: String(Corn) (Required)
-     *     plantingStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     weatherExtensionId: String (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId JobId provided by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of biomass model job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateBiomassModelJob(String jobId, BinaryData job, - RequestOptions requestOptions) { - return this.serviceClient.beginCreateBiomassModelJobAsync(jobId, job, requestOptions); - } - - /** - * Get Biomass Model job's details. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     cropName: String(Corn) (Required)
-     *     plantingStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     weatherExtensionId: String (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return biomass Model job's details along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getBiomassModelJobWithResponse(String jobId, RequestOptions requestOptions) { - return this.serviceClient.getBiomassModelJobWithResponseAsync(jobId, requestOptions); - } - - /** - * Create a Sensor Placement Model job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     sensorType: String (Required)
-     *     isRanked: boolean (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     sensorType: String (Required)
-     *     isRanked: boolean (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId JobId provided by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of sensor placement model job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateSensorPlacementModelJob(String jobId, BinaryData job, - RequestOptions requestOptions) { - return this.serviceClient.beginCreateSensorPlacementModelJobAsync(jobId, job, requestOptions); - } - - /** - * Get Sensor Placement Model job's details. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     sensorType: String (Required)
-     *     isRanked: boolean (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensor Placement Model job's details along with {@link Response} on successful completion of {@link - * Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSensorPlacementModelJobWithResponse(String jobId, - RequestOptions requestOptions) { - return this.serviceClient.getSensorPlacementModelJobWithResponseAsync(jobId, requestOptions); - } - - /** - * Create a SoilMoisture Model job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     sensorDataModelId: String (Required)
-     *     sensorPartnerId: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     modelVersion: String (Required)
-     *     sensorDefinition (Required): {
-     *         sensorMeasurement: String (Required)
-     *         minProperty: String (Required)
-     *         maxProperty: String (Required)
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     sensorDataModelId: String (Required)
-     *     sensorPartnerId: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     modelVersion: String (Required)
-     *     sensorDefinition (Required): {
-     *         sensorMeasurement: String (Required)
-     *         minProperty: String (Required)
-     *         maxProperty: String (Required)
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId JobId provided by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of soil moisture model job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateSoilMoistureModelJob(String jobId, BinaryData job, - RequestOptions requestOptions) { - return this.serviceClient.beginCreateSoilMoistureModelJobAsync(jobId, job, requestOptions); - } - - /** - * Get SoilMoisture Model job's details. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     sensorDataModelId: String (Required)
-     *     sensorPartnerId: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     modelVersion: String (Required)
-     *     sensorDefinition (Required): {
-     *         sensorMeasurement: String (Required)
-     *         minProperty: String (Required)
-     *         maxProperty: String (Required)
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return soilMoisture Model job's details along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSoilMoistureModelJobWithResponse(String jobId, RequestOptions requestOptions) { - return this.serviceClient.getSoilMoistureModelJobWithResponseAsync(jobId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ModelInferenceClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ModelInferenceClient.java deleted file mode 100644 index cd0439ee30fe..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ModelInferenceClient.java +++ /dev/null @@ -1,458 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.SyncPoller; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = ModelInferenceClientBuilder.class) -public final class ModelInferenceClient { - @Generated - private final ModelInferenceAsyncClient client; - - /** - * Initializes an instance of ModelInferenceClient class. - * - * @param client the async client. - */ - @Generated - ModelInferenceClient(ModelInferenceAsyncClient client) { - this.client = client; - } - - /** - * Create a Biomass Model job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     cropName: String(Corn) (Required)
-     *     plantingStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     weatherExtensionId: String (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     cropName: String(Corn) (Required)
-     *     plantingStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     weatherExtensionId: String (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId JobId provided by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of biomass model job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateBiomassModelJob(String jobId, BinaryData job, - RequestOptions requestOptions) { - return this.client.beginCreateBiomassModelJob(jobId, job, requestOptions).getSyncPoller(); - } - - /** - * Get Biomass Model job's details. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     cropName: String(Corn) (Required)
-     *     plantingStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     weatherExtensionId: String (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return biomass Model job's details along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getBiomassModelJobWithResponse(String jobId, RequestOptions requestOptions) { - return this.client.getBiomassModelJobWithResponse(jobId, requestOptions).block(); - } - - /** - * Create a Sensor Placement Model job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     sensorType: String (Required)
-     *     isRanked: boolean (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     sensorType: String (Required)
-     *     isRanked: boolean (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId JobId provided by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of sensor placement model job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateSensorPlacementModelJob(String jobId, BinaryData job, - RequestOptions requestOptions) { - return this.client.beginCreateSensorPlacementModelJob(jobId, job, requestOptions).getSyncPoller(); - } - - /** - * Get Sensor Placement Model job's details. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     sensorType: String (Required)
-     *     isRanked: boolean (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensor Placement Model job's details along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSensorPlacementModelJobWithResponse(String jobId, RequestOptions requestOptions) { - return this.client.getSensorPlacementModelJobWithResponse(jobId, requestOptions).block(); - } - - /** - * Create a SoilMoisture Model job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     sensorDataModelId: String (Required)
-     *     sensorPartnerId: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     modelVersion: String (Required)
-     *     sensorDefinition (Required): {
-     *         sensorMeasurement: String (Required)
-     *         minProperty: String (Required)
-     *         maxProperty: String (Required)
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     sensorDataModelId: String (Required)
-     *     sensorPartnerId: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     modelVersion: String (Required)
-     *     sensorDefinition (Required): {
-     *         sensorMeasurement: String (Required)
-     *         minProperty: String (Required)
-     *         maxProperty: String (Required)
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId JobId provided by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of soil moisture model job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateSoilMoistureModelJob(String jobId, BinaryData job, - RequestOptions requestOptions) { - return this.client.beginCreateSoilMoistureModelJob(jobId, job, requestOptions).getSyncPoller(); - } - - /** - * Get SoilMoisture Model job's details. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     sensorDataModelId: String (Required)
-     *     sensorPartnerId: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     modelVersion: String (Required)
-     *     sensorDefinition (Required): {
-     *         sensorMeasurement: String (Required)
-     *         minProperty: String (Required)
-     *         maxProperty: String (Required)
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return soilMoisture Model job's details along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSoilMoistureModelJobWithResponse(String jobId, RequestOptions requestOptions) { - return this.client.getSoilMoistureModelJobWithResponse(jobId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ModelInferenceClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ModelInferenceClientBuilder.java deleted file mode 100644 index 6e9efff495d8..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ModelInferenceClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the ModelInferenceClient type. */ -@ServiceClientBuilder(serviceClients = { ModelInferenceClient.class, ModelInferenceAsyncClient.class }) -public final class ModelInferenceClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the ModelInferenceClientBuilder. */ - @Generated - public ModelInferenceClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public ModelInferenceClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public ModelInferenceClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public ModelInferenceClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public ModelInferenceClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public ModelInferenceClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public ModelInferenceClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public ModelInferenceClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public ModelInferenceClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public ModelInferenceClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the ModelInferenceClientBuilder. - */ - @Generated - public ModelInferenceClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the ModelInferenceClientBuilder. - */ - @Generated - public ModelInferenceClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of ModelInferenceAsyncClient class. - * - * @return an instance of ModelInferenceAsyncClient. - */ - @Generated - public ModelInferenceAsyncClient buildAsyncClient() { - return new ModelInferenceAsyncClient(buildInnerClient().getModelInferences()); - } - - /** - * Builds an instance of ModelInferenceClient class. - * - * @return an instance of ModelInferenceClient. - */ - @Generated - public ModelInferenceClient buildClient() { - return new ModelInferenceClient(new ModelInferenceAsyncClient(buildInnerClient().getModelInferences())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/NutrientAnalysesAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/NutrientAnalysesAsyncClient.java deleted file mode 100644 index cad7bbda61a1..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/NutrientAnalysesAsyncClient.java +++ /dev/null @@ -1,363 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.verticals.agrifood.farming.implementation.NutrientAnalysesImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = NutrientAnalysesClientBuilder.class, isAsync = true) -public final class NutrientAnalysesAsyncClient { - @Generated - private final NutrientAnalysesImpl serviceClient; - - /** - * Initializes an instance of NutrientAnalysesAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - NutrientAnalysesAsyncClient(NutrientAnalysesImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of nutrient analysis resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
parentTypeStringNoType of the parent it belongs to. - * i.e. PlantTissueAnalysis.
parentIdsList<String>NoParent ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
classificationsList<String>NoClassifications for nutrient analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     parentType: String(PlantTissueAnalysis) (Optional)
-     *     unit: String (Optional)
-     *     value: Double (Optional)
-     *     referenceValueLow: Double (Optional)
-     *     referenceValueHigh: Double (Optional)
-     *     classification: String (Optional)
-     *     recommendation: String (Optional)
-     *     products (Optional): [
-     *          (Optional){
-     *             rate: String (Optional)
-     *             instruction: String (Optional)
-     *             product: String (Optional)
-     *         }
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(RequestOptions requestOptions) { - return this.serviceClient.listAsync(requestOptions); - } - - /** - * Returns a paginated list of nutrient analysis resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
parentTypeStringNoType of the parent it belongs to. - * i.e. PlantTissueAnalysis.
parentIdsList<String>NoParent ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
classificationsList<String>NoClassifications for nutrient analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     parentType: String(PlantTissueAnalysis) (Optional)
-     *     unit: String (Optional)
-     *     value: Double (Optional)
-     *     referenceValueLow: Double (Optional)
-     *     referenceValueHigh: Double (Optional)
-     *     classification: String (Optional)
-     *     recommendation: String (Optional)
-     *     products (Optional): [
-     *          (Optional){
-     *             rate: String (Optional)
-     *             instruction: String (Optional)
-     *             product: String (Optional)
-     *         }
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyId(String partyId, RequestOptions requestOptions) { - return this.serviceClient.listByPartyIdAsync(partyId, requestOptions); - } - - /** - * Gets a specified nutrient analysis resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     parentType: String(PlantTissueAnalysis) (Optional)
-     *     unit: String (Optional)
-     *     value: Double (Optional)
-     *     referenceValueLow: Double (Optional)
-     *     referenceValueHigh: Double (Optional)
-     *     classification: String (Optional)
-     *     recommendation: String (Optional)
-     *     products (Optional): [
-     *          (Optional){
-     *             rate: String (Optional)
-     *             instruction: String (Optional)
-     *             product: String (Optional)
-     *         }
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param nutrientAnalysisId Id of the nutrient analysis. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified nutrient analysis resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String partyId, String nutrientAnalysisId, - RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(partyId, nutrientAnalysisId, requestOptions); - } - - /** - * Creates or updates a nutrient analysis resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     parentType: String(PlantTissueAnalysis) (Optional)
-     *     unit: String (Optional)
-     *     value: Double (Optional)
-     *     referenceValueLow: Double (Optional)
-     *     referenceValueHigh: Double (Optional)
-     *     classification: String (Optional)
-     *     recommendation: String (Optional)
-     *     products (Optional): [
-     *          (Optional){
-     *             rate: String (Optional)
-     *             instruction: String (Optional)
-     *             product: String (Optional)
-     *         }
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     parentType: String(PlantTissueAnalysis) (Optional)
-     *     unit: String (Optional)
-     *     value: Double (Optional)
-     *     referenceValueLow: Double (Optional)
-     *     referenceValueHigh: Double (Optional)
-     *     classification: String (Optional)
-     *     recommendation: String (Optional)
-     *     products (Optional): [
-     *          (Optional){
-     *             rate: String (Optional)
-     *             instruction: String (Optional)
-     *             product: String (Optional)
-     *         }
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party resource. - * @param nutrientAnalysisId Id of the nutrient analysis resource. - * @param nutrientAnalysis NutrientAnalysis resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return api Model for nutrient analysis object along with {@link Response} on successful completion of {@link - * Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String partyId, String nutrientAnalysisId, - BinaryData nutrientAnalysis, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(partyId, nutrientAnalysisId, nutrientAnalysis, - requestOptions); - } - - /** - * Deletes a specified nutrient analysis resource under a particular party. - * - * @param partyId Id of the party. - * @param nutrientAnalysisId Id of the nutrient analysis. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String partyId, String nutrientAnalysisId, - RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(partyId, nutrientAnalysisId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/NutrientAnalysesClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/NutrientAnalysesClient.java deleted file mode 100644 index 7f520eeab063..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/NutrientAnalysesClient.java +++ /dev/null @@ -1,358 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = NutrientAnalysesClientBuilder.class) -public final class NutrientAnalysesClient { - @Generated - private final NutrientAnalysesAsyncClient client; - - /** - * Initializes an instance of NutrientAnalysesClient class. - * - * @param client the async client. - */ - @Generated - NutrientAnalysesClient(NutrientAnalysesAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of nutrient analysis resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
parentTypeStringNoType of the parent it belongs to. - * i.e. PlantTissueAnalysis.
parentIdsList<String>NoParent ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
classificationsList<String>NoClassifications for nutrient analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     parentType: String(PlantTissueAnalysis) (Optional)
-     *     unit: String (Optional)
-     *     value: Double (Optional)
-     *     referenceValueLow: Double (Optional)
-     *     referenceValueHigh: Double (Optional)
-     *     classification: String (Optional)
-     *     recommendation: String (Optional)
-     *     products (Optional): [
-     *          (Optional){
-     *             rate: String (Optional)
-     *             instruction: String (Optional)
-     *             product: String (Optional)
-     *         }
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(requestOptions)); - } - - /** - * Returns a paginated list of nutrient analysis resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
parentTypeStringNoType of the parent it belongs to. - * i.e. PlantTissueAnalysis.
parentIdsList<String>NoParent ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
classificationsList<String>NoClassifications for nutrient analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     parentType: String(PlantTissueAnalysis) (Optional)
-     *     unit: String (Optional)
-     *     value: Double (Optional)
-     *     referenceValueLow: Double (Optional)
-     *     referenceValueHigh: Double (Optional)
-     *     classification: String (Optional)
-     *     recommendation: String (Optional)
-     *     products (Optional): [
-     *          (Optional){
-     *             rate: String (Optional)
-     *             instruction: String (Optional)
-     *             product: String (Optional)
-     *         }
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listByPartyId(partyId, requestOptions)); - } - - /** - * Gets a specified nutrient analysis resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     parentType: String(PlantTissueAnalysis) (Optional)
-     *     unit: String (Optional)
-     *     value: Double (Optional)
-     *     referenceValueLow: Double (Optional)
-     *     referenceValueHigh: Double (Optional)
-     *     classification: String (Optional)
-     *     recommendation: String (Optional)
-     *     products (Optional): [
-     *          (Optional){
-     *             rate: String (Optional)
-     *             instruction: String (Optional)
-     *             product: String (Optional)
-     *         }
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param nutrientAnalysisId Id of the nutrient analysis. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified nutrient analysis resource under a particular party along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String nutrientAnalysisId, - RequestOptions requestOptions) { - return this.client.getWithResponse(partyId, nutrientAnalysisId, requestOptions).block(); - } - - /** - * Creates or updates a nutrient analysis resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     parentType: String(PlantTissueAnalysis) (Optional)
-     *     unit: String (Optional)
-     *     value: Double (Optional)
-     *     referenceValueLow: Double (Optional)
-     *     referenceValueHigh: Double (Optional)
-     *     classification: String (Optional)
-     *     recommendation: String (Optional)
-     *     products (Optional): [
-     *          (Optional){
-     *             rate: String (Optional)
-     *             instruction: String (Optional)
-     *             product: String (Optional)
-     *         }
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     parentType: String(PlantTissueAnalysis) (Optional)
-     *     unit: String (Optional)
-     *     value: Double (Optional)
-     *     referenceValueLow: Double (Optional)
-     *     referenceValueHigh: Double (Optional)
-     *     classification: String (Optional)
-     *     recommendation: String (Optional)
-     *     products (Optional): [
-     *          (Optional){
-     *             rate: String (Optional)
-     *             instruction: String (Optional)
-     *             product: String (Optional)
-     *         }
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party resource. - * @param nutrientAnalysisId Id of the nutrient analysis resource. - * @param nutrientAnalysis NutrientAnalysis resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return api Model for nutrient analysis object along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String nutrientAnalysisId, - BinaryData nutrientAnalysis, RequestOptions requestOptions) { - return this.client.createOrUpdateWithResponse(partyId, nutrientAnalysisId, nutrientAnalysis, requestOptions) - .block(); - } - - /** - * Deletes a specified nutrient analysis resource under a particular party. - * - * @param partyId Id of the party. - * @param nutrientAnalysisId Id of the nutrient analysis. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String nutrientAnalysisId, RequestOptions requestOptions) { - return this.client.deleteWithResponse(partyId, nutrientAnalysisId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/NutrientAnalysesClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/NutrientAnalysesClientBuilder.java deleted file mode 100644 index b388e064f637..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/NutrientAnalysesClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the NutrientAnalysesClient type. */ -@ServiceClientBuilder(serviceClients = { NutrientAnalysesClient.class, NutrientAnalysesAsyncClient.class }) -public final class NutrientAnalysesClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the NutrientAnalysesClientBuilder. */ - @Generated - public NutrientAnalysesClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public NutrientAnalysesClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public NutrientAnalysesClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public NutrientAnalysesClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public NutrientAnalysesClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public NutrientAnalysesClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public NutrientAnalysesClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public NutrientAnalysesClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public NutrientAnalysesClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public NutrientAnalysesClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the NutrientAnalysesClientBuilder. - */ - @Generated - public NutrientAnalysesClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the NutrientAnalysesClientBuilder. - */ - @Generated - public NutrientAnalysesClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of NutrientAnalysesAsyncClient class. - * - * @return an instance of NutrientAnalysesAsyncClient. - */ - @Generated - public NutrientAnalysesAsyncClient buildAsyncClient() { - return new NutrientAnalysesAsyncClient(buildInnerClient().getNutrientAnalyses()); - } - - /** - * Builds an instance of NutrientAnalysesClient class. - * - * @return an instance of NutrientAnalysesClient. - */ - @Generated - public NutrientAnalysesClient buildClient() { - return new NutrientAnalysesClient(new NutrientAnalysesAsyncClient(buildInnerClient().getNutrientAnalyses())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/OAuthProvidersAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/OAuthProvidersAsyncClient.java deleted file mode 100644 index 81b9f0211c08..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/OAuthProvidersAsyncClient.java +++ /dev/null @@ -1,303 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollerFlux; -import com.azure.verticals.agrifood.farming.implementation.OAuthProvidersImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = OAuthProvidersClientBuilder.class, isAsync = true) -public final class OAuthProvidersAsyncClient { - @Generated - private final OAuthProvidersImpl serviceClient; - - /** - * Initializes an instance of OAuthProvidersAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - OAuthProvidersAsyncClient(OAuthProvidersImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of oauthProvider resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     appId: String (Optional)
-     *     appSecret: String (Optional)
-     *     apiKey: String (Optional)
-     *     isProductionApp: Boolean (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(RequestOptions requestOptions) { - return this.serviceClient.listAsync(requestOptions); - } - - /** - * Get a specified oauthProvider resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     appId: String (Optional)
-     *     appSecret: String (Optional)
-     *     apiKey: String (Optional)
-     *     isProductionApp: Boolean (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param oauthProviderId ID of the oauthProvider resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified oauthProvider resource along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String oauthProviderId, RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(oauthProviderId, requestOptions); - } - - /** - * Creates or updates an oauthProvider resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     appId: String (Optional)
-     *     appSecret: String (Optional)
-     *     apiKey: String (Optional)
-     *     isProductionApp: Boolean (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     appId: String (Optional)
-     *     appSecret: String (Optional)
-     *     apiKey: String (Optional)
-     *     isProductionApp: Boolean (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param oauthProviderId ID of oauthProvider resource. - * @param oauthProvider OauthProvider resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of OAuth provider resource along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String oauthProviderId, BinaryData oauthProvider, - RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(oauthProviderId, oauthProvider, requestOptions); - } - - /** - * Deletes an specified oauthProvider resource. - * - * @param oauthProviderId ID of oauthProvider. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String oauthProviderId, RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(oauthProviderId, requestOptions); - } - - /** - * Get cascade delete job for oauthProvider resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     oauthProviderId: String (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for oauthProvider resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponse(String jobId, - RequestOptions requestOptions) { - return this.serviceClient.getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions); - } - - /** - * Create cascade delete job for oauthProvider resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     oauthProviderId: String (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param oauthProviderId Id of the application data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of oauth provider cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJob(String jobId, String oauthProviderId, - RequestOptions requestOptions) { - return this.serviceClient.beginCreateCascadeDeleteJobAsync(jobId, oauthProviderId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/OAuthProvidersClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/OAuthProvidersClient.java deleted file mode 100644 index 43f3f0c487d7..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/OAuthProvidersClient.java +++ /dev/null @@ -1,299 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.SyncPoller; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = OAuthProvidersClientBuilder.class) -public final class OAuthProvidersClient { - @Generated - private final OAuthProvidersAsyncClient client; - - /** - * Initializes an instance of OAuthProvidersClient class. - * - * @param client the async client. - */ - @Generated - OAuthProvidersClient(OAuthProvidersAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of oauthProvider resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     appId: String (Optional)
-     *     appSecret: String (Optional)
-     *     apiKey: String (Optional)
-     *     isProductionApp: Boolean (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(requestOptions)); - } - - /** - * Get a specified oauthProvider resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     appId: String (Optional)
-     *     appSecret: String (Optional)
-     *     apiKey: String (Optional)
-     *     isProductionApp: Boolean (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param oauthProviderId ID of the oauthProvider resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified oauthProvider resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String oauthProviderId, RequestOptions requestOptions) { - return this.client.getWithResponse(oauthProviderId, requestOptions).block(); - } - - /** - * Creates or updates an oauthProvider resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     appId: String (Optional)
-     *     appSecret: String (Optional)
-     *     apiKey: String (Optional)
-     *     isProductionApp: Boolean (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     appId: String (Optional)
-     *     appSecret: String (Optional)
-     *     apiKey: String (Optional)
-     *     isProductionApp: Boolean (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param oauthProviderId ID of oauthProvider resource. - * @param oauthProvider OauthProvider resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of OAuth provider resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String oauthProviderId, BinaryData oauthProvider, - RequestOptions requestOptions) { - return this.client.createOrUpdateWithResponse(oauthProviderId, oauthProvider, requestOptions).block(); - } - - /** - * Deletes an specified oauthProvider resource. - * - * @param oauthProviderId ID of oauthProvider. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String oauthProviderId, RequestOptions requestOptions) { - return this.client.deleteWithResponse(oauthProviderId, requestOptions).block(); - } - - /** - * Get cascade delete job for oauthProvider resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     oauthProviderId: String (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for oauthProvider resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return this.client.getCascadeDeleteJobDetailsWithResponse(jobId, requestOptions).block(); - } - - /** - * Create cascade delete job for oauthProvider resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     oauthProviderId: String (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param oauthProviderId Id of the application data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of oauth provider cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String oauthProviderId, - RequestOptions requestOptions) { - return this.client.beginCreateCascadeDeleteJob(jobId, oauthProviderId, requestOptions).getSyncPoller(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/OAuthProvidersClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/OAuthProvidersClientBuilder.java deleted file mode 100644 index e4512f82e6ee..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/OAuthProvidersClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the OAuthProvidersClient type. */ -@ServiceClientBuilder(serviceClients = { OAuthProvidersClient.class, OAuthProvidersAsyncClient.class }) -public final class OAuthProvidersClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the OAuthProvidersClientBuilder. */ - @Generated - public OAuthProvidersClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public OAuthProvidersClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public OAuthProvidersClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public OAuthProvidersClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public OAuthProvidersClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public OAuthProvidersClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public OAuthProvidersClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public OAuthProvidersClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public OAuthProvidersClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public OAuthProvidersClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the OAuthProvidersClientBuilder. - */ - @Generated - public OAuthProvidersClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the OAuthProvidersClientBuilder. - */ - @Generated - public OAuthProvidersClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of OAuthProvidersAsyncClient class. - * - * @return an instance of OAuthProvidersAsyncClient. - */ - @Generated - public OAuthProvidersAsyncClient buildAsyncClient() { - return new OAuthProvidersAsyncClient(buildInnerClient().getOAuthProviders()); - } - - /** - * Builds an instance of OAuthProvidersClient class. - * - * @return an instance of OAuthProvidersClient. - */ - @Generated - public OAuthProvidersClient buildClient() { - return new OAuthProvidersClient(new OAuthProvidersAsyncClient(buildInnerClient().getOAuthProviders())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/OAuthTokensAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/OAuthTokensAsyncClient.java deleted file mode 100644 index 95cf780fee09..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/OAuthTokensAsyncClient.java +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollerFlux; -import com.azure.verticals.agrifood.farming.implementation.OAuthTokensImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = OAuthTokensClientBuilder.class, isAsync = true) -public final class OAuthTokensAsyncClient { - @Generated - private final OAuthTokensImpl serviceClient; - - /** - * Initializes an instance of OAuthTokensAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - OAuthTokensAsyncClient(OAuthTokensImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a list of OAuthToken documents. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
authProviderIdsList<String>NoName of AuthProvider. Call {@link RequestOptions#addQueryParam} to add string to array.
partyIdsList<String>NoList of parties. Call {@link RequestOptions#addQueryParam} to add string to array.
isValidBooleanNoIf the token object is valid.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     authProviderId: String (Required)
-     *     isValid: Boolean (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(RequestOptions requestOptions) { - return this.serviceClient.listAsync(requestOptions); - } - - /** - * Returns Connection link needed in the OAuth flow. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     oAuthProviderId: String (Required)
-     *     userRedirectLink: String (Required)
-     *     userRedirectState: String (Optional)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * String
-     * }
- * - * @param oauthConnectRequest OAuth Connect Request. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getOAuthConnectionLinkWithResponse(BinaryData oauthConnectRequest, - RequestOptions requestOptions) { - return this.serviceClient.getOAuthConnectionLinkWithResponseAsync(oauthConnectRequest, requestOptions); - } - - /** - * Get remove job for OAuth token. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return remove job for OAuth token along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponse(String jobId, - RequestOptions requestOptions) { - return this.serviceClient.getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions); - } - - /** - * Create remove job for OAuth token. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param partyId Id of the party. - * @param oauthProviderId Id of the OAuthProvider. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJob(String jobId, String partyId, - String oauthProviderId, RequestOptions requestOptions) { - return this.serviceClient.beginCreateCascadeDeleteJobAsync(jobId, partyId, oauthProviderId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/OAuthTokensClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/OAuthTokensClient.java deleted file mode 100644 index 77e822424333..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/OAuthTokensClient.java +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.SyncPoller; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = OAuthTokensClientBuilder.class) -public final class OAuthTokensClient { - @Generated - private final OAuthTokensAsyncClient client; - - /** - * Initializes an instance of OAuthTokensClient class. - * - * @param client the async client. - */ - @Generated - OAuthTokensClient(OAuthTokensAsyncClient client) { - this.client = client; - } - - /** - * Returns a list of OAuthToken documents. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
authProviderIdsList<String>NoName of AuthProvider. Call {@link RequestOptions#addQueryParam} to add string to array.
partyIdsList<String>NoList of parties. Call {@link RequestOptions#addQueryParam} to add string to array.
isValidBooleanNoIf the token object is valid.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     authProviderId: String (Required)
-     *     isValid: Boolean (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(requestOptions)); - } - - /** - * Returns Connection link needed in the OAuth flow. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     oAuthProviderId: String (Required)
-     *     userRedirectLink: String (Required)
-     *     userRedirectState: String (Optional)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * String
-     * }
- * - * @param oauthConnectRequest OAuth Connect Request. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getOAuthConnectionLinkWithResponse(BinaryData oauthConnectRequest, - RequestOptions requestOptions) { - return this.client.getOAuthConnectionLinkWithResponse(oauthConnectRequest, requestOptions).block(); - } - - /** - * Get remove job for OAuth token. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return remove job for OAuth token along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return this.client.getCascadeDeleteJobDetailsWithResponse(jobId, requestOptions).block(); - } - - /** - * Create remove job for OAuth token. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param partyId Id of the party. - * @param oauthProviderId Id of the OAuthProvider. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, - String oauthProviderId, RequestOptions requestOptions) { - return this.client.beginCreateCascadeDeleteJob(jobId, partyId, oauthProviderId, requestOptions).getSyncPoller(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/OAuthTokensClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/OAuthTokensClientBuilder.java deleted file mode 100644 index 696806bce891..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/OAuthTokensClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the OAuthTokensClient type. */ -@ServiceClientBuilder(serviceClients = { OAuthTokensClient.class, OAuthTokensAsyncClient.class }) -public final class OAuthTokensClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the OAuthTokensClientBuilder. */ - @Generated - public OAuthTokensClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public OAuthTokensClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public OAuthTokensClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public OAuthTokensClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public OAuthTokensClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public OAuthTokensClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public OAuthTokensClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public OAuthTokensClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public OAuthTokensClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public OAuthTokensClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the OAuthTokensClientBuilder. - */ - @Generated - public OAuthTokensClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the OAuthTokensClientBuilder. - */ - @Generated - public OAuthTokensClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of OAuthTokensAsyncClient class. - * - * @return an instance of OAuthTokensAsyncClient. - */ - @Generated - public OAuthTokensAsyncClient buildAsyncClient() { - return new OAuthTokensAsyncClient(buildInnerClient().getOAuthTokens()); - } - - /** - * Builds an instance of OAuthTokensClient class. - * - * @return an instance of OAuthTokensClient. - */ - @Generated - public OAuthTokensClient buildClient() { - return new OAuthTokensClient(new OAuthTokensAsyncClient(buildInnerClient().getOAuthTokens())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PartiesAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PartiesAsyncClient.java deleted file mode 100644 index c7d6be6fd608..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PartiesAsyncClient.java +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollerFlux; -import com.azure.verticals.agrifood.farming.implementation.PartiesImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = PartiesClientBuilder.class, isAsync = true) -public final class PartiesAsyncClient { - @Generated - private final PartiesImpl serviceClient; - - /** - * Initializes an instance of PartiesAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - PartiesAsyncClient(PartiesImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of party resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(RequestOptions requestOptions) { - return this.serviceClient.listAsync(requestOptions); - } - - /** - * Gets a specified party resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified party resource along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String partyId, RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(partyId, requestOptions); - } - - /** - * Creates or updates a party resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party resource. - * @param party Party resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of party resource along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String partyId, BinaryData party, - RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(partyId, party, requestOptions); - } - - /** - * Deletes a specified party resource. - * - * @param partyId Id of party to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String partyId, RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(partyId, requestOptions); - } - - /** - * Get a cascade delete job for specified party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified party along with {@link Response} on successful completion of {@link - * Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponse(String jobId, - RequestOptions requestOptions) { - return this.serviceClient.getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions); - } - - /** - * Create a cascade delete job for specified party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the party to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJob(String jobId, String partyId, - RequestOptions requestOptions) { - return this.serviceClient.beginCreateCascadeDeleteJobAsync(jobId, partyId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PartiesClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PartiesClient.java deleted file mode 100644 index a7d1ecf5f751..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PartiesClient.java +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.SyncPoller; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = PartiesClientBuilder.class) -public final class PartiesClient { - @Generated - private final PartiesAsyncClient client; - - /** - * Initializes an instance of PartiesClient class. - * - * @param client the async client. - */ - @Generated - PartiesClient(PartiesAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of party resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(requestOptions)); - } - - /** - * Gets a specified party resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified party resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, RequestOptions requestOptions) { - return this.client.getWithResponse(partyId, requestOptions).block(); - } - - /** - * Creates or updates a party resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party resource. - * @param party Party resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of party resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, BinaryData party, - RequestOptions requestOptions) { - return this.client.createOrUpdateWithResponse(partyId, party, requestOptions).block(); - } - - /** - * Deletes a specified party resource. - * - * @param partyId Id of party to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, RequestOptions requestOptions) { - return this.client.deleteWithResponse(partyId, requestOptions).block(); - } - - /** - * Get a cascade delete job for specified party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified party along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return this.client.getCascadeDeleteJobDetailsWithResponse(jobId, requestOptions).block(); - } - - /** - * Create a cascade delete job for specified party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the party to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, - RequestOptions requestOptions) { - return this.client.beginCreateCascadeDeleteJob(jobId, partyId, requestOptions).getSyncPoller(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PartiesClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PartiesClientBuilder.java deleted file mode 100644 index 1d5247c7f7f6..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PartiesClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the PartiesClient type. */ -@ServiceClientBuilder(serviceClients = { PartiesClient.class, PartiesAsyncClient.class }) -public final class PartiesClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the PartiesClientBuilder. */ - @Generated - public PartiesClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public PartiesClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public PartiesClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public PartiesClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public PartiesClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public PartiesClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public PartiesClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public PartiesClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public PartiesClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public PartiesClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the PartiesClientBuilder. - */ - @Generated - public PartiesClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the PartiesClientBuilder. - */ - @Generated - public PartiesClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of PartiesAsyncClient class. - * - * @return an instance of PartiesAsyncClient. - */ - @Generated - public PartiesAsyncClient buildAsyncClient() { - return new PartiesAsyncClient(buildInnerClient().getParties()); - } - - /** - * Builds an instance of PartiesClient class. - * - * @return an instance of PartiesClient. - */ - @Generated - public PartiesClient buildClient() { - return new PartiesClient(new PartiesAsyncClient(buildInnerClient().getParties())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PlantTissueAnalysesAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PlantTissueAnalysesAsyncClient.java deleted file mode 100644 index 5dcfea46e4f7..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PlantTissueAnalysesAsyncClient.java +++ /dev/null @@ -1,467 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollerFlux; -import com.azure.verticals.agrifood.farming.implementation.PlantTissueAnalysesImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = PlantTissueAnalysesClientBuilder.class, isAsync = true) -public final class PlantTissueAnalysesAsyncClient { - @Generated - private final PlantTissueAnalysesImpl serviceClient; - - /** - * Initializes an instance of PlantTissueAnalysesAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - PlantTissueAnalysesAsyncClient(PlantTissueAnalysesImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of plant tissue analysis resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
seasonIdsList<String>NoSeason ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCrop ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
cropProductsIdsList<String>NoCrop products ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     fieldId: String (Optional)
-     *     cropId: String (Optional)
-     *     cropProductId: String (Optional)
-     *     seasonId: String (Optional)
-     *     plantingDateTime: OffsetDateTime (Optional)
-     *     growthStage: String (Optional)
-     *     plantPart: String (Optional)
-     *     plantPosition: String (Optional)
-     *     plantAppearance: String (Optional)
-     *     sampleCollectionCondition: String (Optional)
-     *     sampleCollectionDateTime: OffsetDateTime (Optional)
-     *     sampleReceivedDateTime: OffsetDateTime (Optional)
-     *     sampleTestResultDateTime: OffsetDateTime (Optional)
-     *     labDetails (Optional): {
-     *         code: String (Optional)
-     *         name: String (Optional)
-     *         description: String (Optional)
-     *         address: String (Optional)
-     *     }
-     *     attachmentsLink: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyId(String partyId, RequestOptions requestOptions) { - return this.serviceClient.listByPartyIdAsync(partyId, requestOptions); - } - - /** - * Gets a specified plant tissue analysis resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     fieldId: String (Optional)
-     *     cropId: String (Optional)
-     *     cropProductId: String (Optional)
-     *     seasonId: String (Optional)
-     *     plantingDateTime: OffsetDateTime (Optional)
-     *     growthStage: String (Optional)
-     *     plantPart: String (Optional)
-     *     plantPosition: String (Optional)
-     *     plantAppearance: String (Optional)
-     *     sampleCollectionCondition: String (Optional)
-     *     sampleCollectionDateTime: OffsetDateTime (Optional)
-     *     sampleReceivedDateTime: OffsetDateTime (Optional)
-     *     sampleTestResultDateTime: OffsetDateTime (Optional)
-     *     labDetails (Optional): {
-     *         code: String (Optional)
-     *         name: String (Optional)
-     *         description: String (Optional)
-     *         address: String (Optional)
-     *     }
-     *     attachmentsLink: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param plantTissueAnalysisId Id of the plant tissue analysis. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified plant tissue analysis resource under a particular party along with {@link Response} on - * successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String partyId, String plantTissueAnalysisId, - RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(partyId, plantTissueAnalysisId, requestOptions); - } - - /** - * Creates or updates a plant tissue analysis resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     fieldId: String (Optional)
-     *     cropId: String (Optional)
-     *     cropProductId: String (Optional)
-     *     seasonId: String (Optional)
-     *     plantingDateTime: OffsetDateTime (Optional)
-     *     growthStage: String (Optional)
-     *     plantPart: String (Optional)
-     *     plantPosition: String (Optional)
-     *     plantAppearance: String (Optional)
-     *     sampleCollectionCondition: String (Optional)
-     *     sampleCollectionDateTime: OffsetDateTime (Optional)
-     *     sampleReceivedDateTime: OffsetDateTime (Optional)
-     *     sampleTestResultDateTime: OffsetDateTime (Optional)
-     *     labDetails (Optional): {
-     *         code: String (Optional)
-     *         name: String (Optional)
-     *         description: String (Optional)
-     *         address: String (Optional)
-     *     }
-     *     attachmentsLink: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     fieldId: String (Optional)
-     *     cropId: String (Optional)
-     *     cropProductId: String (Optional)
-     *     seasonId: String (Optional)
-     *     plantingDateTime: OffsetDateTime (Optional)
-     *     growthStage: String (Optional)
-     *     plantPart: String (Optional)
-     *     plantPosition: String (Optional)
-     *     plantAppearance: String (Optional)
-     *     sampleCollectionCondition: String (Optional)
-     *     sampleCollectionDateTime: OffsetDateTime (Optional)
-     *     sampleReceivedDateTime: OffsetDateTime (Optional)
-     *     sampleTestResultDateTime: OffsetDateTime (Optional)
-     *     labDetails (Optional): {
-     *         code: String (Optional)
-     *         name: String (Optional)
-     *         description: String (Optional)
-     *         address: String (Optional)
-     *     }
-     *     attachmentsLink: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party resource. - * @param plantTissueAnalysisId Id of the plant tissue analysis resource. - * @param plantTissueAnalysis PlantTissueAnalysis resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return api Model for plant tissue analysis object along with {@link Response} on successful completion of {@link - * Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String partyId, String plantTissueAnalysisId, - BinaryData plantTissueAnalysis, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(partyId, plantTissueAnalysisId, plantTissueAnalysis, - requestOptions); - } - - /** - * Deletes a specified plant tissue analysis resource under a particular party. - * - * @param partyId Id of the party. - * @param plantTissueAnalysisId Id of the plant tissue analysis. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String partyId, String plantTissueAnalysisId, - RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(partyId, plantTissueAnalysisId, requestOptions); - } - - /** - * Returns a paginated list of plant tissue analysis resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
seasonIdsList<String>NoSeason ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCrop ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
cropProductsIdsList<String>NoCrop products ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     fieldId: String (Optional)
-     *     cropId: String (Optional)
-     *     cropProductId: String (Optional)
-     *     seasonId: String (Optional)
-     *     plantingDateTime: OffsetDateTime (Optional)
-     *     growthStage: String (Optional)
-     *     plantPart: String (Optional)
-     *     plantPosition: String (Optional)
-     *     plantAppearance: String (Optional)
-     *     sampleCollectionCondition: String (Optional)
-     *     sampleCollectionDateTime: OffsetDateTime (Optional)
-     *     sampleReceivedDateTime: OffsetDateTime (Optional)
-     *     sampleTestResultDateTime: OffsetDateTime (Optional)
-     *     labDetails (Optional): {
-     *         code: String (Optional)
-     *         name: String (Optional)
-     *         description: String (Optional)
-     *         address: String (Optional)
-     *     }
-     *     attachmentsLink: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(RequestOptions requestOptions) { - return this.serviceClient.listAsync(requestOptions); - } - - /** - * Create a cascade delete job for specified plant tissue analysis. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param plantTissueAnalysisId ID of the plant tissue analysis to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJob(String jobId, String partyId, - String plantTissueAnalysisId, RequestOptions requestOptions) { - return this.serviceClient.beginCreateCascadeDeleteJobAsync(jobId, partyId, plantTissueAnalysisId, - requestOptions); - } - - /** - * Get a cascade delete job for specified plant tissue analysis. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified plant tissue analysis along with {@link Response} on successful - * completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponse(String jobId, - RequestOptions requestOptions) { - return this.serviceClient.getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PlantTissueAnalysesClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PlantTissueAnalysesClient.java deleted file mode 100644 index 3b3abe6b1ceb..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PlantTissueAnalysesClient.java +++ /dev/null @@ -1,462 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.SyncPoller; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = PlantTissueAnalysesClientBuilder.class) -public final class PlantTissueAnalysesClient { - @Generated - private final PlantTissueAnalysesAsyncClient client; - - /** - * Initializes an instance of PlantTissueAnalysesClient class. - * - * @param client the async client. - */ - @Generated - PlantTissueAnalysesClient(PlantTissueAnalysesAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of plant tissue analysis resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
seasonIdsList<String>NoSeason ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCrop ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
cropProductsIdsList<String>NoCrop products ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     fieldId: String (Optional)
-     *     cropId: String (Optional)
-     *     cropProductId: String (Optional)
-     *     seasonId: String (Optional)
-     *     plantingDateTime: OffsetDateTime (Optional)
-     *     growthStage: String (Optional)
-     *     plantPart: String (Optional)
-     *     plantPosition: String (Optional)
-     *     plantAppearance: String (Optional)
-     *     sampleCollectionCondition: String (Optional)
-     *     sampleCollectionDateTime: OffsetDateTime (Optional)
-     *     sampleReceivedDateTime: OffsetDateTime (Optional)
-     *     sampleTestResultDateTime: OffsetDateTime (Optional)
-     *     labDetails (Optional): {
-     *         code: String (Optional)
-     *         name: String (Optional)
-     *         description: String (Optional)
-     *         address: String (Optional)
-     *     }
-     *     attachmentsLink: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listByPartyId(partyId, requestOptions)); - } - - /** - * Gets a specified plant tissue analysis resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     fieldId: String (Optional)
-     *     cropId: String (Optional)
-     *     cropProductId: String (Optional)
-     *     seasonId: String (Optional)
-     *     plantingDateTime: OffsetDateTime (Optional)
-     *     growthStage: String (Optional)
-     *     plantPart: String (Optional)
-     *     plantPosition: String (Optional)
-     *     plantAppearance: String (Optional)
-     *     sampleCollectionCondition: String (Optional)
-     *     sampleCollectionDateTime: OffsetDateTime (Optional)
-     *     sampleReceivedDateTime: OffsetDateTime (Optional)
-     *     sampleTestResultDateTime: OffsetDateTime (Optional)
-     *     labDetails (Optional): {
-     *         code: String (Optional)
-     *         name: String (Optional)
-     *         description: String (Optional)
-     *         address: String (Optional)
-     *     }
-     *     attachmentsLink: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param plantTissueAnalysisId Id of the plant tissue analysis. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified plant tissue analysis resource under a particular party along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String plantTissueAnalysisId, - RequestOptions requestOptions) { - return this.client.getWithResponse(partyId, plantTissueAnalysisId, requestOptions).block(); - } - - /** - * Creates or updates a plant tissue analysis resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     fieldId: String (Optional)
-     *     cropId: String (Optional)
-     *     cropProductId: String (Optional)
-     *     seasonId: String (Optional)
-     *     plantingDateTime: OffsetDateTime (Optional)
-     *     growthStage: String (Optional)
-     *     plantPart: String (Optional)
-     *     plantPosition: String (Optional)
-     *     plantAppearance: String (Optional)
-     *     sampleCollectionCondition: String (Optional)
-     *     sampleCollectionDateTime: OffsetDateTime (Optional)
-     *     sampleReceivedDateTime: OffsetDateTime (Optional)
-     *     sampleTestResultDateTime: OffsetDateTime (Optional)
-     *     labDetails (Optional): {
-     *         code: String (Optional)
-     *         name: String (Optional)
-     *         description: String (Optional)
-     *         address: String (Optional)
-     *     }
-     *     attachmentsLink: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     fieldId: String (Optional)
-     *     cropId: String (Optional)
-     *     cropProductId: String (Optional)
-     *     seasonId: String (Optional)
-     *     plantingDateTime: OffsetDateTime (Optional)
-     *     growthStage: String (Optional)
-     *     plantPart: String (Optional)
-     *     plantPosition: String (Optional)
-     *     plantAppearance: String (Optional)
-     *     sampleCollectionCondition: String (Optional)
-     *     sampleCollectionDateTime: OffsetDateTime (Optional)
-     *     sampleReceivedDateTime: OffsetDateTime (Optional)
-     *     sampleTestResultDateTime: OffsetDateTime (Optional)
-     *     labDetails (Optional): {
-     *         code: String (Optional)
-     *         name: String (Optional)
-     *         description: String (Optional)
-     *         address: String (Optional)
-     *     }
-     *     attachmentsLink: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party resource. - * @param plantTissueAnalysisId Id of the plant tissue analysis resource. - * @param plantTissueAnalysis PlantTissueAnalysis resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return api Model for plant tissue analysis object along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String plantTissueAnalysisId, - BinaryData plantTissueAnalysis, RequestOptions requestOptions) { - return this.client - .createOrUpdateWithResponse(partyId, plantTissueAnalysisId, plantTissueAnalysis, requestOptions) - .block(); - } - - /** - * Deletes a specified plant tissue analysis resource under a particular party. - * - * @param partyId Id of the party. - * @param plantTissueAnalysisId Id of the plant tissue analysis. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String plantTissueAnalysisId, - RequestOptions requestOptions) { - return this.client.deleteWithResponse(partyId, plantTissueAnalysisId, requestOptions).block(); - } - - /** - * Returns a paginated list of plant tissue analysis resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
seasonIdsList<String>NoSeason ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCrop ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
cropProductsIdsList<String>NoCrop products ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     fieldId: String (Optional)
-     *     cropId: String (Optional)
-     *     cropProductId: String (Optional)
-     *     seasonId: String (Optional)
-     *     plantingDateTime: OffsetDateTime (Optional)
-     *     growthStage: String (Optional)
-     *     plantPart: String (Optional)
-     *     plantPosition: String (Optional)
-     *     plantAppearance: String (Optional)
-     *     sampleCollectionCondition: String (Optional)
-     *     sampleCollectionDateTime: OffsetDateTime (Optional)
-     *     sampleReceivedDateTime: OffsetDateTime (Optional)
-     *     sampleTestResultDateTime: OffsetDateTime (Optional)
-     *     labDetails (Optional): {
-     *         code: String (Optional)
-     *         name: String (Optional)
-     *         description: String (Optional)
-     *         address: String (Optional)
-     *     }
-     *     attachmentsLink: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(requestOptions)); - } - - /** - * Create a cascade delete job for specified plant tissue analysis. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param plantTissueAnalysisId ID of the plant tissue analysis to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, - String plantTissueAnalysisId, RequestOptions requestOptions) { - return this.client.beginCreateCascadeDeleteJob(jobId, partyId, plantTissueAnalysisId, requestOptions) - .getSyncPoller(); - } - - /** - * Get a cascade delete job for specified plant tissue analysis. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified plant tissue analysis along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return this.client.getCascadeDeleteJobDetailsWithResponse(jobId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PlantTissueAnalysesClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PlantTissueAnalysesClientBuilder.java deleted file mode 100644 index 9139e28a54de..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PlantTissueAnalysesClientBuilder.java +++ /dev/null @@ -1,303 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the PlantTissueAnalysesClient type. */ -@ServiceClientBuilder(serviceClients = { PlantTissueAnalysesClient.class, PlantTissueAnalysesAsyncClient.class }) -public final class PlantTissueAnalysesClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the PlantTissueAnalysesClientBuilder. */ - @Generated - public PlantTissueAnalysesClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public PlantTissueAnalysesClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public PlantTissueAnalysesClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public PlantTissueAnalysesClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public PlantTissueAnalysesClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public PlantTissueAnalysesClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public PlantTissueAnalysesClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public PlantTissueAnalysesClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public PlantTissueAnalysesClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public PlantTissueAnalysesClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the PlantTissueAnalysesClientBuilder. - */ - @Generated - public PlantTissueAnalysesClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the PlantTissueAnalysesClientBuilder. - */ - @Generated - public PlantTissueAnalysesClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of PlantTissueAnalysesAsyncClient class. - * - * @return an instance of PlantTissueAnalysesAsyncClient. - */ - @Generated - public PlantTissueAnalysesAsyncClient buildAsyncClient() { - return new PlantTissueAnalysesAsyncClient(buildInnerClient().getPlantTissueAnalyses()); - } - - /** - * Builds an instance of PlantTissueAnalysesClient class. - * - * @return an instance of PlantTissueAnalysesClient. - */ - @Generated - public PlantTissueAnalysesClient buildClient() { - return new PlantTissueAnalysesClient( - new PlantTissueAnalysesAsyncClient(buildInnerClient().getPlantTissueAnalyses())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PlantingDataAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PlantingDataAsyncClient.java deleted file mode 100644 index e335daf72e45..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PlantingDataAsyncClient.java +++ /dev/null @@ -1,489 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollerFlux; -import com.azure.verticals.agrifood.farming.implementation.PlantingDatasImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = PlantingDataClientBuilder.class, isAsync = true) -public final class PlantingDataAsyncClient { - @Generated - private final PlantingDatasImpl serviceClient; - - /** - * Initializes an instance of PlantingDataAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - PlantingDataAsyncClient(PlantingDatasImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of planting data resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minAvgPlantingRateDoubleNoMinimum AvgPlantingRate value(inclusive).
maxAvgPlantingRateDoubleNoMaximum AvgPlantingRate value (inclusive).
minTotalMaterialDoubleNoMinimum TotalMaterial value(inclusive).
maxTotalMaterialDoubleNoMaximum TotalMaterial value (inclusive).
minAvgMaterialDoubleNoMinimum AvgMaterial value(inclusive).
maxAvgMaterialDoubleNoMaximum AvgMaterial value (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     avgPlantingRate (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     plantingProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *             avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyId(String partyId, RequestOptions requestOptions) { - return this.serviceClient.listByPartyIdAsync(partyId, requestOptions); - } - - /** - * Get a specified planting data resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     avgPlantingRate (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     plantingProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *             avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party resource. - * @param plantingDataId ID of the planting data resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified planting data resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String partyId, String plantingDataId, - RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(partyId, plantingDataId, requestOptions); - } - - /** - * Creates or updates an planting data resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     avgPlantingRate (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     plantingProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *             avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     avgPlantingRate (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     plantingProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *             avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param plantingDataId ID of the planting data resource. - * @param plantingData Planting data resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of planting data resource along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String partyId, String plantingDataId, - BinaryData plantingData, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(partyId, plantingDataId, plantingData, - requestOptions); - } - - /** - * Deletes a specified planting data resource under a particular party. - * - * @param partyId ID of the associated party resource. - * @param plantingDataId ID of the planting data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String partyId, String plantingDataId, - RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(partyId, plantingDataId, requestOptions); - } - - /** - * Returns a paginated list of planting data resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minAvgPlantingRateDoubleNoMinimum AvgPlantingRate value(inclusive).
maxAvgPlantingRateDoubleNoMaximum AvgPlantingRate value (inclusive).
minTotalMaterialDoubleNoMinimum TotalMaterial value(inclusive).
maxTotalMaterialDoubleNoMaximum TotalMaterial value (inclusive).
minAvgMaterialDoubleNoMinimum AvgMaterial value(inclusive).
maxAvgMaterialDoubleNoMaximum AvgMaterial value (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     avgPlantingRate (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     plantingProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *             avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(RequestOptions requestOptions) { - return this.serviceClient.listAsync(requestOptions); - } - - /** - * Create cascade delete job for planting data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param partyId Id of the party. - * @param plantingDataId Id of the planting data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJob(String jobId, String partyId, - String plantingDataId, RequestOptions requestOptions) { - return this.serviceClient.beginCreateCascadeDeleteJobAsync(jobId, partyId, plantingDataId, requestOptions); - } - - /** - * Get cascade delete job for planting data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for planting data resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponse(String jobId, - RequestOptions requestOptions) { - return this.serviceClient.getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PlantingDataClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PlantingDataClient.java deleted file mode 100644 index 0cf83976abf6..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PlantingDataClient.java +++ /dev/null @@ -1,481 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.SyncPoller; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = PlantingDataClientBuilder.class) -public final class PlantingDataClient { - @Generated - private final PlantingDataAsyncClient client; - - /** - * Initializes an instance of PlantingDataClient class. - * - * @param client the async client. - */ - @Generated - PlantingDataClient(PlantingDataAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of planting data resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minAvgPlantingRateDoubleNoMinimum AvgPlantingRate value(inclusive).
maxAvgPlantingRateDoubleNoMaximum AvgPlantingRate value (inclusive).
minTotalMaterialDoubleNoMinimum TotalMaterial value(inclusive).
maxTotalMaterialDoubleNoMaximum TotalMaterial value (inclusive).
minAvgMaterialDoubleNoMinimum AvgMaterial value(inclusive).
maxAvgMaterialDoubleNoMaximum AvgMaterial value (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     avgPlantingRate (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     plantingProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *             avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listByPartyId(partyId, requestOptions)); - } - - /** - * Get a specified planting data resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     avgPlantingRate (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     plantingProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *             avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party resource. - * @param plantingDataId ID of the planting data resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified planting data resource under a particular party along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String plantingDataId, RequestOptions requestOptions) { - return this.client.getWithResponse(partyId, plantingDataId, requestOptions).block(); - } - - /** - * Creates or updates an planting data resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     avgPlantingRate (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     plantingProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *             avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     avgPlantingRate (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     plantingProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *             avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param plantingDataId ID of the planting data resource. - * @param plantingData Planting data resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of planting data resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String plantingDataId, - BinaryData plantingData, RequestOptions requestOptions) { - return this.client.createOrUpdateWithResponse(partyId, plantingDataId, plantingData, requestOptions).block(); - } - - /** - * Deletes a specified planting data resource under a particular party. - * - * @param partyId ID of the associated party resource. - * @param plantingDataId ID of the planting data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String plantingDataId, RequestOptions requestOptions) { - return this.client.deleteWithResponse(partyId, plantingDataId, requestOptions).block(); - } - - /** - * Returns a paginated list of planting data resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minAvgPlantingRateDoubleNoMinimum AvgPlantingRate value(inclusive).
maxAvgPlantingRateDoubleNoMaximum AvgPlantingRate value (inclusive).
minTotalMaterialDoubleNoMinimum TotalMaterial value(inclusive).
maxTotalMaterialDoubleNoMaximum TotalMaterial value (inclusive).
minAvgMaterialDoubleNoMinimum AvgMaterial value(inclusive).
maxAvgMaterialDoubleNoMaximum AvgMaterial value (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     avgPlantingRate (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     plantingProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *             avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(requestOptions)); - } - - /** - * Create cascade delete job for planting data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param partyId Id of the party. - * @param plantingDataId Id of the planting data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, - String plantingDataId, RequestOptions requestOptions) { - return this.client.beginCreateCascadeDeleteJob(jobId, partyId, plantingDataId, requestOptions).getSyncPoller(); - } - - /** - * Get cascade delete job for planting data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for planting data resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return this.client.getCascadeDeleteJobDetailsWithResponse(jobId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PlantingDataClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PlantingDataClientBuilder.java deleted file mode 100644 index 053a6b05b0a6..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PlantingDataClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the PlantingDataClient type. */ -@ServiceClientBuilder(serviceClients = { PlantingDataClient.class, PlantingDataAsyncClient.class }) -public final class PlantingDataClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the PlantingDataClientBuilder. */ - @Generated - public PlantingDataClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public PlantingDataClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public PlantingDataClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public PlantingDataClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public PlantingDataClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public PlantingDataClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public PlantingDataClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public PlantingDataClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public PlantingDataClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public PlantingDataClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the PlantingDataClientBuilder. - */ - @Generated - public PlantingDataClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the PlantingDataClientBuilder. - */ - @Generated - public PlantingDataClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of PlantingDataAsyncClient class. - * - * @return an instance of PlantingDataAsyncClient. - */ - @Generated - public PlantingDataAsyncClient buildAsyncClient() { - return new PlantingDataAsyncClient(buildInnerClient().getPlantingDatas()); - } - - /** - * Builds an instance of PlantingDataClient class. - * - * @return an instance of PlantingDataClient. - */ - @Generated - public PlantingDataClient buildClient() { - return new PlantingDataClient(new PlantingDataAsyncClient(buildInnerClient().getPlantingDatas())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PrescriptionMapsAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PrescriptionMapsAsyncClient.java deleted file mode 100644 index 1860d7779652..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PrescriptionMapsAsyncClient.java +++ /dev/null @@ -1,388 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollerFlux; -import com.azure.verticals.agrifood.farming.implementation.PrescriptionMapsImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = PrescriptionMapsClientBuilder.class, isAsync = true) -public final class PrescriptionMapsAsyncClient { - @Generated - private final PrescriptionMapsImpl serviceClient; - - /** - * Initializes an instance of PrescriptionMapsAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - PrescriptionMapsAsyncClient(PrescriptionMapsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of prescription map resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCrop Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeason Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources for the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyId(String partyId, RequestOptions requestOptions) { - return this.serviceClient.listByPartyIdAsync(partyId, requestOptions); - } - - /** - * Gets a specified prescription map resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param prescriptionMapId Id of the prescription map. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified prescription map resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String partyId, String prescriptionMapId, - RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(partyId, prescriptionMapId, requestOptions); - } - - /** - * Creates or Updates a prescription map resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party resource. - * @param prescriptionMapId Id of the prescription map resource. - * @param prescriptionMap PrescriptionMap resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return api Model for Prescription Map object along with {@link Response} on successful completion of {@link - * Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String partyId, String prescriptionMapId, - BinaryData prescriptionMap, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(partyId, prescriptionMapId, prescriptionMap, - requestOptions); - } - - /** - * Deletes a specified prescription map resource under a particular party. - * - * @param partyId Id of the party. - * @param prescriptionMapId Id of the prescriptionMap. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String partyId, String prescriptionMapId, - RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(partyId, prescriptionMapId, requestOptions); - } - - /** - * Returns a paginated list of prescription map resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCrop Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeason Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources for the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(RequestOptions requestOptions) { - return this.serviceClient.listAsync(requestOptions); - } - - /** - * Get a cascade delete job for specified prescription map. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified prescription map along with {@link Response} on successful completion - * of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponse(String jobId, - RequestOptions requestOptions) { - return this.serviceClient.getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions); - } - - /** - * Create a cascade delete job for specified prescription map. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param prescriptionMapId ID of the prescription map to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJob(String jobId, String partyId, - String prescriptionMapId, RequestOptions requestOptions) { - return this.serviceClient.beginCreateCascadeDeleteJobAsync(jobId, partyId, prescriptionMapId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PrescriptionMapsClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PrescriptionMapsClient.java deleted file mode 100644 index dd8403f911e8..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PrescriptionMapsClient.java +++ /dev/null @@ -1,382 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.SyncPoller; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = PrescriptionMapsClientBuilder.class) -public final class PrescriptionMapsClient { - @Generated - private final PrescriptionMapsAsyncClient client; - - /** - * Initializes an instance of PrescriptionMapsClient class. - * - * @param client the async client. - */ - @Generated - PrescriptionMapsClient(PrescriptionMapsAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of prescription map resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCrop Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeason Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources for the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listByPartyId(partyId, requestOptions)); - } - - /** - * Gets a specified prescription map resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param prescriptionMapId Id of the prescription map. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified prescription map resource under a particular party along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String prescriptionMapId, - RequestOptions requestOptions) { - return this.client.getWithResponse(partyId, prescriptionMapId, requestOptions).block(); - } - - /** - * Creates or Updates a prescription map resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party resource. - * @param prescriptionMapId Id of the prescription map resource. - * @param prescriptionMap PrescriptionMap resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return api Model for Prescription Map object along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String prescriptionMapId, - BinaryData prescriptionMap, RequestOptions requestOptions) { - return this.client.createOrUpdateWithResponse(partyId, prescriptionMapId, prescriptionMap, requestOptions) - .block(); - } - - /** - * Deletes a specified prescription map resource under a particular party. - * - * @param partyId Id of the party. - * @param prescriptionMapId Id of the prescriptionMap. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String prescriptionMapId, RequestOptions requestOptions) { - return this.client.deleteWithResponse(partyId, prescriptionMapId, requestOptions).block(); - } - - /** - * Returns a paginated list of prescription map resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCrop Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeason Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources for the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(requestOptions)); - } - - /** - * Get a cascade delete job for specified prescription map. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified prescription map along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return this.client.getCascadeDeleteJobDetailsWithResponse(jobId, requestOptions).block(); - } - - /** - * Create a cascade delete job for specified prescription map. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param prescriptionMapId ID of the prescription map to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, - String prescriptionMapId, RequestOptions requestOptions) { - return this.client.beginCreateCascadeDeleteJob(jobId, partyId, prescriptionMapId, requestOptions) - .getSyncPoller(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PrescriptionMapsClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PrescriptionMapsClientBuilder.java deleted file mode 100644 index 8ab4cddf750a..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PrescriptionMapsClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the PrescriptionMapsClient type. */ -@ServiceClientBuilder(serviceClients = { PrescriptionMapsClient.class, PrescriptionMapsAsyncClient.class }) -public final class PrescriptionMapsClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the PrescriptionMapsClientBuilder. */ - @Generated - public PrescriptionMapsClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public PrescriptionMapsClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public PrescriptionMapsClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public PrescriptionMapsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public PrescriptionMapsClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public PrescriptionMapsClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public PrescriptionMapsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public PrescriptionMapsClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public PrescriptionMapsClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public PrescriptionMapsClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the PrescriptionMapsClientBuilder. - */ - @Generated - public PrescriptionMapsClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the PrescriptionMapsClientBuilder. - */ - @Generated - public PrescriptionMapsClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of PrescriptionMapsAsyncClient class. - * - * @return an instance of PrescriptionMapsAsyncClient. - */ - @Generated - public PrescriptionMapsAsyncClient buildAsyncClient() { - return new PrescriptionMapsAsyncClient(buildInnerClient().getPrescriptionMaps()); - } - - /** - * Builds an instance of PrescriptionMapsClient class. - * - * @return an instance of PrescriptionMapsClient. - */ - @Generated - public PrescriptionMapsClient buildClient() { - return new PrescriptionMapsClient(new PrescriptionMapsAsyncClient(buildInnerClient().getPrescriptionMaps())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PrescriptionsAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PrescriptionsAsyncClient.java deleted file mode 100644 index 3c42426d8a56..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PrescriptionsAsyncClient.java +++ /dev/null @@ -1,417 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollerFlux; -import com.azure.verticals.agrifood.farming.implementation.PrescriptionsImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = PrescriptionsClientBuilder.class, isAsync = true) -public final class PrescriptionsAsyncClient { - @Generated - private final PrescriptionsImpl serviceClient; - - /** - * Initializes an instance of PrescriptionsAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - PrescriptionsAsyncClient(PrescriptionsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of prescription resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
prescriptionMapIdsList<String>NoPrescription Map Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
typesList<String>NoTypes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
productCodesList<String>NoProduct Codes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
productNamesList<String>NoProduct Names of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources for the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     prescriptionMapId: String (Optional)
-     *     productCode: String (Optional)
-     *     productName: String (Optional)
-     *     type: String (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyId(String partyId, RequestOptions requestOptions) { - return this.serviceClient.listByPartyIdAsync(partyId, requestOptions); - } - - /** - * Gets a specified prescription resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     prescriptionMapId: String (Optional)
-     *     productCode: String (Optional)
-     *     productName: String (Optional)
-     *     type: String (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param prescriptionId Id of the prescription. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified prescription resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String partyId, String prescriptionId, - RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(partyId, prescriptionId, requestOptions); - } - - /** - * Creates or Updates a prescription resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     prescriptionMapId: String (Optional)
-     *     productCode: String (Optional)
-     *     productName: String (Optional)
-     *     type: String (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     prescriptionMapId: String (Optional)
-     *     productCode: String (Optional)
-     *     productName: String (Optional)
-     *     type: String (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party resource. - * @param prescriptionId Id of the prescription resource. - * @param prescription Prescription resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return api Model for Prescription object along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String partyId, String prescriptionId, - BinaryData prescription, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(partyId, prescriptionId, prescription, - requestOptions); - } - - /** - * Deletes a specified prescription resource under a particular party. - * - * @param partyId Id of the party. - * @param prescriptionId Id of the prescription. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String partyId, String prescriptionId, - RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(partyId, prescriptionId, requestOptions); - } - - /** - * Returns a paginated list of prescription resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
prescriptionMapIdsList<String>NoPrescription Map Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
typesList<String>NoTypes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
productCodesList<String>NoProduct Codes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
productNamesList<String>NoProduct Names of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources for the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     prescriptionMapId: String (Optional)
-     *     productCode: String (Optional)
-     *     productName: String (Optional)
-     *     type: String (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(RequestOptions requestOptions) { - return this.serviceClient.listAsync(requestOptions); - } - - /** - * Get a cascade delete job for specified prescription. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified prescription along with {@link Response} on successful completion of - * {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponse(String jobId, - RequestOptions requestOptions) { - return this.serviceClient.getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions); - } - - /** - * Create a cascade delete job for specified prescription. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param prescriptionId ID of the prescription to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJob(String jobId, String partyId, - String prescriptionId, RequestOptions requestOptions) { - return this.serviceClient.beginCreateCascadeDeleteJobAsync(jobId, partyId, prescriptionId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PrescriptionsClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PrescriptionsClient.java deleted file mode 100644 index f3d6e8b7111f..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PrescriptionsClient.java +++ /dev/null @@ -1,409 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.SyncPoller; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = PrescriptionsClientBuilder.class) -public final class PrescriptionsClient { - @Generated - private final PrescriptionsAsyncClient client; - - /** - * Initializes an instance of PrescriptionsClient class. - * - * @param client the async client. - */ - @Generated - PrescriptionsClient(PrescriptionsAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of prescription resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
prescriptionMapIdsList<String>NoPrescription Map Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
typesList<String>NoTypes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
productCodesList<String>NoProduct Codes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
productNamesList<String>NoProduct Names of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources for the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     prescriptionMapId: String (Optional)
-     *     productCode: String (Optional)
-     *     productName: String (Optional)
-     *     type: String (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listByPartyId(partyId, requestOptions)); - } - - /** - * Gets a specified prescription resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     prescriptionMapId: String (Optional)
-     *     productCode: String (Optional)
-     *     productName: String (Optional)
-     *     type: String (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param prescriptionId Id of the prescription. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified prescription resource under a particular party along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String prescriptionId, RequestOptions requestOptions) { - return this.client.getWithResponse(partyId, prescriptionId, requestOptions).block(); - } - - /** - * Creates or Updates a prescription resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     prescriptionMapId: String (Optional)
-     *     productCode: String (Optional)
-     *     productName: String (Optional)
-     *     type: String (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     prescriptionMapId: String (Optional)
-     *     productCode: String (Optional)
-     *     productName: String (Optional)
-     *     type: String (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party resource. - * @param prescriptionId Id of the prescription resource. - * @param prescription Prescription resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return api Model for Prescription object along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String prescriptionId, - BinaryData prescription, RequestOptions requestOptions) { - return this.client.createOrUpdateWithResponse(partyId, prescriptionId, prescription, requestOptions).block(); - } - - /** - * Deletes a specified prescription resource under a particular party. - * - * @param partyId Id of the party. - * @param prescriptionId Id of the prescription. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String prescriptionId, RequestOptions requestOptions) { - return this.client.deleteWithResponse(partyId, prescriptionId, requestOptions).block(); - } - - /** - * Returns a paginated list of prescription resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
prescriptionMapIdsList<String>NoPrescription Map Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
typesList<String>NoTypes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
productCodesList<String>NoProduct Codes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
productNamesList<String>NoProduct Names of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources for the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     prescriptionMapId: String (Optional)
-     *     productCode: String (Optional)
-     *     productName: String (Optional)
-     *     type: String (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(requestOptions)); - } - - /** - * Get a cascade delete job for specified prescription. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified prescription along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return this.client.getCascadeDeleteJobDetailsWithResponse(jobId, requestOptions).block(); - } - - /** - * Create a cascade delete job for specified prescription. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param prescriptionId ID of the prescription to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, - String prescriptionId, RequestOptions requestOptions) { - return this.client.beginCreateCascadeDeleteJob(jobId, partyId, prescriptionId, requestOptions).getSyncPoller(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PrescriptionsClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PrescriptionsClientBuilder.java deleted file mode 100644 index c68ac722199b..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/PrescriptionsClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the PrescriptionsClient type. */ -@ServiceClientBuilder(serviceClients = { PrescriptionsClient.class, PrescriptionsAsyncClient.class }) -public final class PrescriptionsClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the PrescriptionsClientBuilder. */ - @Generated - public PrescriptionsClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public PrescriptionsClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public PrescriptionsClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public PrescriptionsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public PrescriptionsClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public PrescriptionsClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public PrescriptionsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public PrescriptionsClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public PrescriptionsClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public PrescriptionsClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the PrescriptionsClientBuilder. - */ - @Generated - public PrescriptionsClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the PrescriptionsClientBuilder. - */ - @Generated - public PrescriptionsClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of PrescriptionsAsyncClient class. - * - * @return an instance of PrescriptionsAsyncClient. - */ - @Generated - public PrescriptionsAsyncClient buildAsyncClient() { - return new PrescriptionsAsyncClient(buildInnerClient().getPrescriptions()); - } - - /** - * Builds an instance of PrescriptionsClient class. - * - * @return an instance of PrescriptionsClient. - */ - @Generated - public PrescriptionsClient buildClient() { - return new PrescriptionsClient(new PrescriptionsAsyncClient(buildInnerClient().getPrescriptions())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ScenesAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ScenesAsyncClient.java deleted file mode 100644 index 4dcbdca6b1de..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ScenesAsyncClient.java +++ /dev/null @@ -1,434 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollerFlux; -import com.azure.verticals.agrifood.farming.implementation.ScenesImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = ScenesClientBuilder.class, isAsync = true) -public final class ScenesAsyncClient { - @Generated - private final ScenesImpl serviceClient; - - /** - * Initializes an instance of ScenesAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - ScenesAsyncClient(ScenesImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of scene resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
startDateTimeOffsetDateTimeNoScene start UTC datetime (inclusive), sample format: yyyy-MM-ddThh:mm:ssZ.
endDateTimeOffsetDateTimeNoScene end UTC datetime (inclusive), sample format: yyyy-MM-dThh:mm:ssZ.
maxCloudCoveragePercentageDoubleNoFilter scenes with cloud coverage percentage less than max value. Range [0 to 100.0].
maxDarkPixelCoveragePercentageDoubleNoFilter scenes with dark pixel coverage percentage less than max value. Range [0 to 100.0].
imageNamesList<String>NoList of image names to be filtered. Call {@link RequestOptions#addQueryParam} to add string to array.
imageResolutionsList<Double>NoList of image resolutions in meters to be filtered. Call {@link RequestOptions#addQueryParam} to add string to array.
imageFormatsList<String>NoList of image formats to be filtered. Call {@link RequestOptions#addQueryParam} to add string to array.
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sceneDateTime: OffsetDateTime (Optional)
-     *     provider: String (Optional)
-     *     source: String (Optional)
-     *     imageFiles (Optional): [
-     *          (Optional){
-     *             fileLink: String (Optional)
-     *             name: String (Required)
-     *             imageFormat: String(TIF) (Optional)
-     *             resolution: Double (Optional)
-     *         }
-     *     ]
-     *     imageFormat: String(TIF) (Optional)
-     *     cloudCoverPercentage: Double (Optional)
-     *     darkPixelPercentage: Double (Optional)
-     *     ndviMedianValue: Double (Optional)
-     *     boundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param provider Provider name of scene data. - * @param partyId PartyId. - * @param boundaryId BoundaryId. - * @param source Source name of scene data, Available Values: Sentinel_2_L2A, Sentinel_2_L1C. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(String provider, String partyId, String boundaryId, String source, - RequestOptions requestOptions) { - return this.serviceClient.listAsync(provider, partyId, boundaryId, source, requestOptions); - } - - /** - * Downloads and returns file Stream as response for the given input filePath. - * - *

Response Body Schema - * - *

{@code
-     * BinaryData
-     * }
- * - * @param filePath cloud storage path of scene file. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> downloadWithResponse(String filePath, RequestOptions requestOptions) { - return this.serviceClient.downloadWithResponseAsync(filePath, requestOptions); - } - - /** - * Create a satellite data ingestion job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     startDateTime: OffsetDateTime (Required)
-     *     endDateTime: OffsetDateTime (Required)
-     *     provider: String(Microsoft) (Optional)
-     *     source: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     data (Optional): {
-     *         imageNames (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageFormats (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageResolutions (Optional): [
-     *             double (Optional)
-     *         ]
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     startDateTime: OffsetDateTime (Required)
-     *     endDateTime: OffsetDateTime (Required)
-     *     provider: String(Microsoft) (Optional)
-     *     source: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     data (Optional): {
-     *         imageNames (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageFormats (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageResolutions (Optional): [
-     *             double (Optional)
-     *         ]
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId JobId provided by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of satellite data ingestion job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateSatelliteDataIngestionJob(String jobId, BinaryData job, - RequestOptions requestOptions) { - return this.serviceClient.beginCreateSatelliteDataIngestionJobAsync(jobId, job, requestOptions); - } - - /** - * Get a satellite data ingestion job. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     startDateTime: OffsetDateTime (Required)
-     *     endDateTime: OffsetDateTime (Required)
-     *     provider: String(Microsoft) (Optional)
-     *     source: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     data (Optional): {
-     *         imageNames (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageFormats (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageResolutions (Optional): [
-     *             double (Optional)
-     *         ]
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a satellite data ingestion job along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSatelliteDataIngestionJobDetailsWithResponse(String jobId, - RequestOptions requestOptions) { - return this.serviceClient.getSatelliteDataIngestionJobDetailsWithResponseAsync(jobId, requestOptions); - } - - /** - * Search for STAC features by collection id, bbox, intersecting geometry, start and end datetime. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoMaximum number of features needed (inclusive). Minimum = 1, Maximum = 100, Default value = 10.
skipIntegerNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     startDateTime: OffsetDateTime (Required)
-     *     endDateTime: OffsetDateTime (Required)
-     *     intersects (Optional): {
-     *     }
-     *     bbox (Optional): [
-     *         double (Optional)
-     *     ]
-     *     featureIds (Optional): [
-     *         String (Optional)
-     *     ]
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     features (Required): [
-     *          (Required){
-     *             stacVersion: String (Required)
-     *             stacExtensions (Optional): [
-     *                 String (Optional)
-     *             ]
-     *             id: String (Required)
-     *             type: String (Required)
-     *             geometry: Object (Optional)
-     *             bbox (Optional): [
-     *                 double (Optional)
-     *             ]
-     *             properties: Object (Required)
-     *             links (Required): [
-     *                  (Required){
-     *                     href: String (Required)
-     *                     rel: String (Required)
-     *                     type: String (Optional)
-     *                     title: String (Optional)
-     *                 }
-     *             ]
-     *             assets (Required): {
-     *                 String (Required): {
-     *                     href: String (Required)
-     *                     title: String (Optional)
-     *                     description: String (Optional)
-     *                     type: String (Optional)
-     *                     roles (Optional): [
-     *                         String (Optional)
-     *                     ]
-     *                 }
-     *             }
-     *             collection: String (Optional)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
-     * }
-     * }
- * - * @param collectionId Collection Id to be searched. Allowed values: "Sentinel_2_L2A", "Sentinel_2_L1C". - * @param searchFeaturesQuery Query filters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of features and next property to get the next set of results along with - * {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> searchFeaturesWithResponse(String collectionId, BinaryData searchFeaturesQuery, - RequestOptions requestOptions) { - return this.serviceClient.searchFeaturesWithResponseAsync(collectionId, searchFeaturesQuery, requestOptions); - } - - /** - * Get a feature(SpatioTemporal Asset Catalog (STAC) Item) for given collection and feature id. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     stacVersion: String (Required)
-     *     stacExtensions (Optional): [
-     *         String (Optional)
-     *     ]
-     *     id: String (Required)
-     *     type: String (Required)
-     *     geometry: Object (Optional)
-     *     bbox (Optional): [
-     *         double (Optional)
-     *     ]
-     *     properties: Object (Required)
-     *     links (Required): [
-     *          (Required){
-     *             href: String (Required)
-     *             rel: String (Required)
-     *             type: String (Optional)
-     *             title: String (Optional)
-     *         }
-     *     ]
-     *     assets (Required): {
-     *         String (Required): {
-     *             href: String (Required)
-     *             title: String (Optional)
-     *             description: String (Optional)
-     *             type: String (Optional)
-     *             roles (Optional): [
-     *                 String (Optional)
-     *             ]
-     *         }
-     *     }
-     *     collection: String (Optional)
-     * }
-     * }
- * - * @param collectionId Collection Id to be fetched. Allowed values: "Sentinel_2_L2A", "Sentinel_2_L1C". - * @param featureId Feature Id to be fetched. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a feature(SpatioTemporal Asset Catalog (STAC) Item) for given collection and feature id along with {@link - * Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStacFeatureWithResponse(String collectionId, String featureId, - RequestOptions requestOptions) { - return this.serviceClient.getStacFeatureWithResponseAsync(collectionId, featureId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ScenesClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ScenesClient.java deleted file mode 100644 index 2036db2cb613..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ScenesClient.java +++ /dev/null @@ -1,432 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.SyncPoller; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = ScenesClientBuilder.class) -public final class ScenesClient { - @Generated - private final ScenesAsyncClient client; - - /** - * Initializes an instance of ScenesClient class. - * - * @param client the async client. - */ - @Generated - ScenesClient(ScenesAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of scene resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
startDateTimeOffsetDateTimeNoScene start UTC datetime (inclusive), sample format: yyyy-MM-ddThh:mm:ssZ.
endDateTimeOffsetDateTimeNoScene end UTC datetime (inclusive), sample format: yyyy-MM-dThh:mm:ssZ.
maxCloudCoveragePercentageDoubleNoFilter scenes with cloud coverage percentage less than max value. Range [0 to 100.0].
maxDarkPixelCoveragePercentageDoubleNoFilter scenes with dark pixel coverage percentage less than max value. Range [0 to 100.0].
imageNamesList<String>NoList of image names to be filtered. Call {@link RequestOptions#addQueryParam} to add string to array.
imageResolutionsList<Double>NoList of image resolutions in meters to be filtered. Call {@link RequestOptions#addQueryParam} to add string to array.
imageFormatsList<String>NoList of image formats to be filtered. Call {@link RequestOptions#addQueryParam} to add string to array.
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sceneDateTime: OffsetDateTime (Optional)
-     *     provider: String (Optional)
-     *     source: String (Optional)
-     *     imageFiles (Optional): [
-     *          (Optional){
-     *             fileLink: String (Optional)
-     *             name: String (Required)
-     *             imageFormat: String(TIF) (Optional)
-     *             resolution: Double (Optional)
-     *         }
-     *     ]
-     *     imageFormat: String(TIF) (Optional)
-     *     cloudCoverPercentage: Double (Optional)
-     *     darkPixelPercentage: Double (Optional)
-     *     ndviMedianValue: Double (Optional)
-     *     boundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param provider Provider name of scene data. - * @param partyId PartyId. - * @param boundaryId BoundaryId. - * @param source Source name of scene data, Available Values: Sentinel_2_L2A, Sentinel_2_L1C. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String provider, String partyId, String boundaryId, String source, - RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(provider, partyId, boundaryId, source, requestOptions)); - } - - /** - * Downloads and returns file Stream as response for the given input filePath. - * - *

Response Body Schema - * - *

{@code
-     * BinaryData
-     * }
- * - * @param filePath cloud storage path of scene file. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response downloadWithResponse(String filePath, RequestOptions requestOptions) { - return this.client.downloadWithResponse(filePath, requestOptions).block(); - } - - /** - * Create a satellite data ingestion job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     startDateTime: OffsetDateTime (Required)
-     *     endDateTime: OffsetDateTime (Required)
-     *     provider: String(Microsoft) (Optional)
-     *     source: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     data (Optional): {
-     *         imageNames (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageFormats (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageResolutions (Optional): [
-     *             double (Optional)
-     *         ]
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     startDateTime: OffsetDateTime (Required)
-     *     endDateTime: OffsetDateTime (Required)
-     *     provider: String(Microsoft) (Optional)
-     *     source: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     data (Optional): {
-     *         imageNames (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageFormats (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageResolutions (Optional): [
-     *             double (Optional)
-     *         ]
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId JobId provided by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of satellite data ingestion job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateSatelliteDataIngestionJob(String jobId, BinaryData job, - RequestOptions requestOptions) { - return this.client.beginCreateSatelliteDataIngestionJob(jobId, job, requestOptions).getSyncPoller(); - } - - /** - * Get a satellite data ingestion job. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     startDateTime: OffsetDateTime (Required)
-     *     endDateTime: OffsetDateTime (Required)
-     *     provider: String(Microsoft) (Optional)
-     *     source: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     data (Optional): {
-     *         imageNames (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageFormats (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageResolutions (Optional): [
-     *             double (Optional)
-     *         ]
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a satellite data ingestion job along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSatelliteDataIngestionJobDetailsWithResponse(String jobId, - RequestOptions requestOptions) { - return this.client.getSatelliteDataIngestionJobDetailsWithResponse(jobId, requestOptions).block(); - } - - /** - * Search for STAC features by collection id, bbox, intersecting geometry, start and end datetime. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoMaximum number of features needed (inclusive). Minimum = 1, Maximum = 100, Default value = 10.
skipIntegerNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     startDateTime: OffsetDateTime (Required)
-     *     endDateTime: OffsetDateTime (Required)
-     *     intersects (Optional): {
-     *     }
-     *     bbox (Optional): [
-     *         double (Optional)
-     *     ]
-     *     featureIds (Optional): [
-     *         String (Optional)
-     *     ]
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     features (Required): [
-     *          (Required){
-     *             stacVersion: String (Required)
-     *             stacExtensions (Optional): [
-     *                 String (Optional)
-     *             ]
-     *             id: String (Required)
-     *             type: String (Required)
-     *             geometry: Object (Optional)
-     *             bbox (Optional): [
-     *                 double (Optional)
-     *             ]
-     *             properties: Object (Required)
-     *             links (Required): [
-     *                  (Required){
-     *                     href: String (Required)
-     *                     rel: String (Required)
-     *                     type: String (Optional)
-     *                     title: String (Optional)
-     *                 }
-     *             ]
-     *             assets (Required): {
-     *                 String (Required): {
-     *                     href: String (Required)
-     *                     title: String (Optional)
-     *                     description: String (Optional)
-     *                     type: String (Optional)
-     *                     roles (Optional): [
-     *                         String (Optional)
-     *                     ]
-     *                 }
-     *             }
-     *             collection: String (Optional)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
-     * }
-     * }
- * - * @param collectionId Collection Id to be searched. Allowed values: "Sentinel_2_L2A", "Sentinel_2_L1C". - * @param searchFeaturesQuery Query filters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of features and next property to get the next set of results along with - * {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response searchFeaturesWithResponse(String collectionId, BinaryData searchFeaturesQuery, - RequestOptions requestOptions) { - return this.client.searchFeaturesWithResponse(collectionId, searchFeaturesQuery, requestOptions).block(); - } - - /** - * Get a feature(SpatioTemporal Asset Catalog (STAC) Item) for given collection and feature id. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     stacVersion: String (Required)
-     *     stacExtensions (Optional): [
-     *         String (Optional)
-     *     ]
-     *     id: String (Required)
-     *     type: String (Required)
-     *     geometry: Object (Optional)
-     *     bbox (Optional): [
-     *         double (Optional)
-     *     ]
-     *     properties: Object (Required)
-     *     links (Required): [
-     *          (Required){
-     *             href: String (Required)
-     *             rel: String (Required)
-     *             type: String (Optional)
-     *             title: String (Optional)
-     *         }
-     *     ]
-     *     assets (Required): {
-     *         String (Required): {
-     *             href: String (Required)
-     *             title: String (Optional)
-     *             description: String (Optional)
-     *             type: String (Optional)
-     *             roles (Optional): [
-     *                 String (Optional)
-     *             ]
-     *         }
-     *     }
-     *     collection: String (Optional)
-     * }
-     * }
- * - * @param collectionId Collection Id to be fetched. Allowed values: "Sentinel_2_L2A", "Sentinel_2_L1C". - * @param featureId Feature Id to be fetched. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a feature(SpatioTemporal Asset Catalog (STAC) Item) for given collection and feature id along with {@link - * Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getStacFeatureWithResponse(String collectionId, String featureId, - RequestOptions requestOptions) { - return this.client.getStacFeatureWithResponse(collectionId, featureId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ScenesClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ScenesClientBuilder.java deleted file mode 100644 index bb36cec5525a..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ScenesClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the ScenesClient type. */ -@ServiceClientBuilder(serviceClients = { ScenesClient.class, ScenesAsyncClient.class }) -public final class ScenesClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the ScenesClientBuilder. */ - @Generated - public ScenesClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public ScenesClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public ScenesClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public ScenesClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public ScenesClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public ScenesClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public ScenesClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public ScenesClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public ScenesClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public ScenesClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the ScenesClientBuilder. - */ - @Generated - public ScenesClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the ScenesClientBuilder. - */ - @Generated - public ScenesClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of ScenesAsyncClient class. - * - * @return an instance of ScenesAsyncClient. - */ - @Generated - public ScenesAsyncClient buildAsyncClient() { - return new ScenesAsyncClient(buildInnerClient().getScenes()); - } - - /** - * Builds an instance of ScenesClient class. - * - * @return an instance of ScenesClient. - */ - @Generated - public ScenesClient buildClient() { - return new ScenesClient(new ScenesAsyncClient(buildInnerClient().getScenes())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SeasonalFieldsAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SeasonalFieldsAsyncClient.java deleted file mode 100644 index b0afa91a1914..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SeasonalFieldsAsyncClient.java +++ /dev/null @@ -1,402 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollerFlux; -import com.azure.verticals.agrifood.farming.implementation.SeasonalFieldsImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = SeasonalFieldsClientBuilder.class, isAsync = true) -public final class SeasonalFieldsAsyncClient { - @Generated - private final SeasonalFieldsImpl serviceClient; - - /** - * Initializes an instance of SeasonalFieldsAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - SeasonalFieldsAsyncClient(SeasonalFieldsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of seasonal field resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
farmIdsList<String>NoFarm Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeason Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropProductIdsList<String>NoCropProductIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoIds of the crop it belongs to. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     farmId: String (Optional)
-     *     fieldId: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropProductIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     cropId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyId(String partyId, RequestOptions requestOptions) { - return this.serviceClient.listByPartyIdAsync(partyId, requestOptions); - } - - /** - * Gets a specified seasonal field resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     farmId: String (Optional)
-     *     fieldId: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropProductIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     cropId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param seasonalFieldId Id of the seasonal field. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified seasonal field resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String partyId, String seasonalFieldId, - RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(partyId, seasonalFieldId, requestOptions); - } - - /** - * Creates or Updates a seasonal field resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     farmId: String (Optional)
-     *     fieldId: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropProductIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     cropId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     farmId: String (Optional)
-     *     fieldId: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropProductIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     cropId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party resource. - * @param seasonalFieldId Id of the seasonal field resource. - * @param seasonalField Seasonal field resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of seasonal field resource along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String partyId, String seasonalFieldId, - BinaryData seasonalField, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(partyId, seasonalFieldId, seasonalField, - requestOptions); - } - - /** - * Deletes a specified seasonal-field resource under a particular party. - * - * @param partyId Id of the party. - * @param seasonalFieldId Id of the seasonal field. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String partyId, String seasonalFieldId, - RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(partyId, seasonalFieldId, requestOptions); - } - - /** - * Returns a paginated list of seasonal field resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
farmIdsList<String>NoFarm Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeason Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropProductIdsList<String>NoCropProductIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoIds of the crop it belongs to. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     farmId: String (Optional)
-     *     fieldId: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropProductIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     cropId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(RequestOptions requestOptions) { - return this.serviceClient.listAsync(requestOptions); - } - - /** - * Get cascade delete job for specified seasonal field. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for specified seasonal field along with {@link Response} on successful completion of - * {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponse(String jobId, - RequestOptions requestOptions) { - return this.serviceClient.getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions); - } - - /** - * Create a cascade delete job for specified seasonal field. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param seasonalFieldId ID of the seasonalField to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJob(String jobId, String partyId, - String seasonalFieldId, RequestOptions requestOptions) { - return this.serviceClient.beginCreateCascadeDeleteJobAsync(jobId, partyId, seasonalFieldId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SeasonalFieldsClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SeasonalFieldsClient.java deleted file mode 100644 index 721e2ae8b9d3..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SeasonalFieldsClient.java +++ /dev/null @@ -1,394 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.SyncPoller; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = SeasonalFieldsClientBuilder.class) -public final class SeasonalFieldsClient { - @Generated - private final SeasonalFieldsAsyncClient client; - - /** - * Initializes an instance of SeasonalFieldsClient class. - * - * @param client the async client. - */ - @Generated - SeasonalFieldsClient(SeasonalFieldsAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of seasonal field resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
farmIdsList<String>NoFarm Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeason Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropProductIdsList<String>NoCropProductIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoIds of the crop it belongs to. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     farmId: String (Optional)
-     *     fieldId: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropProductIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     cropId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listByPartyId(partyId, requestOptions)); - } - - /** - * Gets a specified seasonal field resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     farmId: String (Optional)
-     *     fieldId: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropProductIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     cropId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param seasonalFieldId Id of the seasonal field. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified seasonal field resource under a particular party along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String seasonalFieldId, RequestOptions requestOptions) { - return this.client.getWithResponse(partyId, seasonalFieldId, requestOptions).block(); - } - - /** - * Creates or Updates a seasonal field resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     farmId: String (Optional)
-     *     fieldId: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropProductIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     cropId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     farmId: String (Optional)
-     *     fieldId: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropProductIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     cropId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party resource. - * @param seasonalFieldId Id of the seasonal field resource. - * @param seasonalField Seasonal field resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of seasonal field resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String seasonalFieldId, - BinaryData seasonalField, RequestOptions requestOptions) { - return this.client.createOrUpdateWithResponse(partyId, seasonalFieldId, seasonalField, requestOptions).block(); - } - - /** - * Deletes a specified seasonal-field resource under a particular party. - * - * @param partyId Id of the party. - * @param seasonalFieldId Id of the seasonal field. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String seasonalFieldId, RequestOptions requestOptions) { - return this.client.deleteWithResponse(partyId, seasonalFieldId, requestOptions).block(); - } - - /** - * Returns a paginated list of seasonal field resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
farmIdsList<String>NoFarm Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeason Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropProductIdsList<String>NoCropProductIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoIds of the crop it belongs to. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     farmId: String (Optional)
-     *     fieldId: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropProductIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     cropId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(requestOptions)); - } - - /** - * Get cascade delete job for specified seasonal field. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for specified seasonal field along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return this.client.getCascadeDeleteJobDetailsWithResponse(jobId, requestOptions).block(); - } - - /** - * Create a cascade delete job for specified seasonal field. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param seasonalFieldId ID of the seasonalField to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, - String seasonalFieldId, RequestOptions requestOptions) { - return this.client.beginCreateCascadeDeleteJob(jobId, partyId, seasonalFieldId, requestOptions).getSyncPoller(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SeasonalFieldsClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SeasonalFieldsClientBuilder.java deleted file mode 100644 index 139b116e21b8..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SeasonalFieldsClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the SeasonalFieldsClient type. */ -@ServiceClientBuilder(serviceClients = { SeasonalFieldsClient.class, SeasonalFieldsAsyncClient.class }) -public final class SeasonalFieldsClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the SeasonalFieldsClientBuilder. */ - @Generated - public SeasonalFieldsClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public SeasonalFieldsClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public SeasonalFieldsClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public SeasonalFieldsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public SeasonalFieldsClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public SeasonalFieldsClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public SeasonalFieldsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public SeasonalFieldsClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public SeasonalFieldsClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public SeasonalFieldsClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the SeasonalFieldsClientBuilder. - */ - @Generated - public SeasonalFieldsClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the SeasonalFieldsClientBuilder. - */ - @Generated - public SeasonalFieldsClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of SeasonalFieldsAsyncClient class. - * - * @return an instance of SeasonalFieldsAsyncClient. - */ - @Generated - public SeasonalFieldsAsyncClient buildAsyncClient() { - return new SeasonalFieldsAsyncClient(buildInnerClient().getSeasonalFields()); - } - - /** - * Builds an instance of SeasonalFieldsClient class. - * - * @return an instance of SeasonalFieldsClient. - */ - @Generated - public SeasonalFieldsClient buildClient() { - return new SeasonalFieldsClient(new SeasonalFieldsAsyncClient(buildInnerClient().getSeasonalFields())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SeasonsAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SeasonsAsyncClient.java deleted file mode 100644 index 6103fe48e52f..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SeasonsAsyncClient.java +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.verticals.agrifood.farming.implementation.SeasonsImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = SeasonsClientBuilder.class, isAsync = true) -public final class SeasonsAsyncClient { - @Generated - private final SeasonsImpl serviceClient; - - /** - * Initializes an instance of SeasonsAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - SeasonsAsyncClient(SeasonsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of season resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minStartDateTimeOffsetDateTimeNoMinimum season start datetime, sample format: yyyy-MM-ddTHH:mm:ssZ.
maxStartDateTimeOffsetDateTimeNoMaximum season start datetime, sample format: yyyy-MM-ddTHH:mm:ssZ.
minEndDateTimeOffsetDateTimeNoMinimum season end datetime, sample format: yyyy-MM-ddTHH:mm:ssZ.
maxEndDateTimeOffsetDateTimeNoMaximum season end datetime, sample format: yyyy-MM-ddTHH:mm:ssZ.
yearsList<Integer>NoYears of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     year: Integer (Optional)
-     *     geographicIdentifier: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(RequestOptions requestOptions) { - return this.serviceClient.listAsync(requestOptions); - } - - /** - * Gets a specified season resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     year: Integer (Optional)
-     *     geographicIdentifier: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param seasonId Id of the season. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified season resource along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String seasonId, RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(seasonId, requestOptions); - } - - /** - * Creates or updates a season resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     year: Integer (Optional)
-     *     geographicIdentifier: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     year: Integer (Optional)
-     *     geographicIdentifier: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param seasonId Id of the season resource. - * @param season Season resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of season resource along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String seasonId, BinaryData season, - RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(seasonId, season, requestOptions); - } - - /** - * Deletes a specified season resource. - * - * @param seasonId Id of the season. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String seasonId, RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(seasonId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SeasonsClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SeasonsClient.java deleted file mode 100644 index d0d8479c9251..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SeasonsClient.java +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = SeasonsClientBuilder.class) -public final class SeasonsClient { - @Generated - private final SeasonsAsyncClient client; - - /** - * Initializes an instance of SeasonsClient class. - * - * @param client the async client. - */ - @Generated - SeasonsClient(SeasonsAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of season resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minStartDateTimeOffsetDateTimeNoMinimum season start datetime, sample format: yyyy-MM-ddTHH:mm:ssZ.
maxStartDateTimeOffsetDateTimeNoMaximum season start datetime, sample format: yyyy-MM-ddTHH:mm:ssZ.
minEndDateTimeOffsetDateTimeNoMinimum season end datetime, sample format: yyyy-MM-ddTHH:mm:ssZ.
maxEndDateTimeOffsetDateTimeNoMaximum season end datetime, sample format: yyyy-MM-ddTHH:mm:ssZ.
yearsList<Integer>NoYears of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     year: Integer (Optional)
-     *     geographicIdentifier: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(requestOptions)); - } - - /** - * Gets a specified season resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     year: Integer (Optional)
-     *     geographicIdentifier: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param seasonId Id of the season. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified season resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String seasonId, RequestOptions requestOptions) { - return this.client.getWithResponse(seasonId, requestOptions).block(); - } - - /** - * Creates or updates a season resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     year: Integer (Optional)
-     *     geographicIdentifier: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     year: Integer (Optional)
-     *     geographicIdentifier: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param seasonId Id of the season resource. - * @param season Season resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of season resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String seasonId, BinaryData season, - RequestOptions requestOptions) { - return this.client.createOrUpdateWithResponse(seasonId, season, requestOptions).block(); - } - - /** - * Deletes a specified season resource. - * - * @param seasonId Id of the season. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String seasonId, RequestOptions requestOptions) { - return this.client.deleteWithResponse(seasonId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SeasonsClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SeasonsClientBuilder.java deleted file mode 100644 index d85a06d98eb3..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SeasonsClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the SeasonsClient type. */ -@ServiceClientBuilder(serviceClients = { SeasonsClient.class, SeasonsAsyncClient.class }) -public final class SeasonsClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the SeasonsClientBuilder. */ - @Generated - public SeasonsClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public SeasonsClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public SeasonsClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public SeasonsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public SeasonsClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public SeasonsClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public SeasonsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public SeasonsClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public SeasonsClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public SeasonsClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the SeasonsClientBuilder. - */ - @Generated - public SeasonsClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the SeasonsClientBuilder. - */ - @Generated - public SeasonsClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of SeasonsAsyncClient class. - * - * @return an instance of SeasonsAsyncClient. - */ - @Generated - public SeasonsAsyncClient buildAsyncClient() { - return new SeasonsAsyncClient(buildInnerClient().getSeasons()); - } - - /** - * Builds an instance of SeasonsClient class. - * - * @return an instance of SeasonsClient. - */ - @Generated - public SeasonsClient buildClient() { - return new SeasonsClient(new SeasonsAsyncClient(buildInnerClient().getSeasons())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorDataModelsAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorDataModelsAsyncClient.java deleted file mode 100644 index b789abd60c39..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorDataModelsAsyncClient.java +++ /dev/null @@ -1,271 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.verticals.agrifood.farming.implementation.SensorDataModelsImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = SensorDataModelsClientBuilder.class, isAsync = true) -public final class SensorDataModelsAsyncClient { - @Generated - private final SensorDataModelsImpl serviceClient; - - /** - * Initializes an instance of SensorDataModelsAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - SensorDataModelsAsyncClient(SensorDataModelsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of sensor data model resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     measures (Required): {
-     *         String (Required): {
-     *             description: String (Optional)
-     *             dataType: String(Bool/Double/DateTime/Long/String) (Required)
-     *             type: String (Optional)
-     *             unit: String (Optional)
-     *             properties (Optional): {
-     *                 String: Object (Optional)
-     *             }
-     *         }
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(String sensorPartnerId, RequestOptions requestOptions) { - return this.serviceClient.listAsync(sensorPartnerId, requestOptions); - } - - /** - * Create a sensor data model entity. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     measures (Required): {
-     *         String (Required): {
-     *             description: String (Optional)
-     *             dataType: String(Bool/Double/DateTime/Long/String) (Required)
-     *             type: String (Optional)
-     *             unit: String (Optional)
-     *             properties (Optional): {
-     *                 String: Object (Optional)
-     *             }
-     *         }
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     measures (Required): {
-     *         String (Required): {
-     *             description: String (Optional)
-     *             dataType: String(Bool/Double/DateTime/Long/String) (Required)
-     *             type: String (Optional)
-     *             unit: String (Optional)
-     *             properties (Optional): {
-     *                 String: Object (Optional)
-     *             }
-     *         }
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorDataModelId Id of the sensor data model. - * @param sensorDataModelObject Sensor data model object details. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensorModel API model along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String sensorPartnerId, String sensorDataModelId, - BinaryData sensorDataModelObject, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(sensorPartnerId, sensorDataModelId, - sensorDataModelObject, requestOptions); - } - - /** - * Gets a sensor data model entity. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     measures (Required): {
-     *         String (Required): {
-     *             description: String (Optional)
-     *             dataType: String(Bool/Double/DateTime/Long/String) (Required)
-     *             type: String (Optional)
-     *             unit: String (Optional)
-     *             properties (Optional): {
-     *                 String: Object (Optional)
-     *             }
-     *         }
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorDataModelId Id of the sensor data model resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a sensor data model entity along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String sensorPartnerId, String sensorDataModelId, - RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(sensorPartnerId, sensorDataModelId, requestOptions); - } - - /** - * Deletes a sensor data model entity. - * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorDataModelId Id of the sensor data model resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String sensorPartnerId, String sensorDataModelId, - RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(sensorPartnerId, sensorDataModelId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorDataModelsClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorDataModelsClient.java deleted file mode 100644 index 048d38eddde2..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorDataModelsClient.java +++ /dev/null @@ -1,270 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = SensorDataModelsClientBuilder.class) -public final class SensorDataModelsClient { - @Generated - private final SensorDataModelsAsyncClient client; - - /** - * Initializes an instance of SensorDataModelsClient class. - * - * @param client the async client. - */ - @Generated - SensorDataModelsClient(SensorDataModelsAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of sensor data model resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     measures (Required): {
-     *         String (Required): {
-     *             description: String (Optional)
-     *             dataType: String(Bool/Double/DateTime/Long/String) (Required)
-     *             type: String (Optional)
-     *             unit: String (Optional)
-     *             properties (Optional): {
-     *                 String: Object (Optional)
-     *             }
-     *         }
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String sensorPartnerId, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(sensorPartnerId, requestOptions)); - } - - /** - * Create a sensor data model entity. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     measures (Required): {
-     *         String (Required): {
-     *             description: String (Optional)
-     *             dataType: String(Bool/Double/DateTime/Long/String) (Required)
-     *             type: String (Optional)
-     *             unit: String (Optional)
-     *             properties (Optional): {
-     *                 String: Object (Optional)
-     *             }
-     *         }
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     measures (Required): {
-     *         String (Required): {
-     *             description: String (Optional)
-     *             dataType: String(Bool/Double/DateTime/Long/String) (Required)
-     *             type: String (Optional)
-     *             unit: String (Optional)
-     *             properties (Optional): {
-     *                 String: Object (Optional)
-     *             }
-     *         }
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorDataModelId Id of the sensor data model. - * @param sensorDataModelObject Sensor data model object details. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensorModel API model along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String sensorPartnerId, String sensorDataModelId, - BinaryData sensorDataModelObject, RequestOptions requestOptions) { - return this.client - .createOrUpdateWithResponse(sensorPartnerId, sensorDataModelId, sensorDataModelObject, requestOptions) - .block(); - } - - /** - * Gets a sensor data model entity. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     measures (Required): {
-     *         String (Required): {
-     *             description: String (Optional)
-     *             dataType: String(Bool/Double/DateTime/Long/String) (Required)
-     *             type: String (Optional)
-     *             unit: String (Optional)
-     *             properties (Optional): {
-     *                 String: Object (Optional)
-     *             }
-     *         }
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorDataModelId Id of the sensor data model resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a sensor data model entity along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String sensorPartnerId, String sensorDataModelId, - RequestOptions requestOptions) { - return this.client.getWithResponse(sensorPartnerId, sensorDataModelId, requestOptions).block(); - } - - /** - * Deletes a sensor data model entity. - * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorDataModelId Id of the sensor data model resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String sensorPartnerId, String sensorDataModelId, - RequestOptions requestOptions) { - return this.client.deleteWithResponse(sensorPartnerId, sensorDataModelId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorDataModelsClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorDataModelsClientBuilder.java deleted file mode 100644 index 1b22a1a6e71d..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorDataModelsClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the SensorDataModelsClient type. */ -@ServiceClientBuilder(serviceClients = { SensorDataModelsClient.class, SensorDataModelsAsyncClient.class }) -public final class SensorDataModelsClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the SensorDataModelsClientBuilder. */ - @Generated - public SensorDataModelsClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorDataModelsClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorDataModelsClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorDataModelsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorDataModelsClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorDataModelsClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorDataModelsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorDataModelsClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorDataModelsClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorDataModelsClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the SensorDataModelsClientBuilder. - */ - @Generated - public SensorDataModelsClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the SensorDataModelsClientBuilder. - */ - @Generated - public SensorDataModelsClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of SensorDataModelsAsyncClient class. - * - * @return an instance of SensorDataModelsAsyncClient. - */ - @Generated - public SensorDataModelsAsyncClient buildAsyncClient() { - return new SensorDataModelsAsyncClient(buildInnerClient().getSensorDataModels()); - } - - /** - * Builds an instance of SensorDataModelsClient class. - * - * @return an instance of SensorDataModelsClient. - */ - @Generated - public SensorDataModelsClient buildClient() { - return new SensorDataModelsClient(new SensorDataModelsAsyncClient(buildInnerClient().getSensorDataModels())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorEventsAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorEventsAsyncClient.java deleted file mode 100644 index 5b4fae7a5b35..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorEventsAsyncClient.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.verticals.agrifood.farming.implementation.SensorEventsImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = SensorEventsClientBuilder.class, isAsync = true) -public final class SensorEventsAsyncClient { - @Generated - private final SensorEventsImpl serviceClient; - - /** - * Initializes an instance of SensorEventsAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - SensorEventsAsyncClient(SensorEventsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a list of sensor events data. Time span for query is limited to 90 days at a time. Returns last 90 days - * events when startDateTime and endDateTime are not provided. - * - *

Query Parameters - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
startDateTimeOffsetDateTimeNoSearch span start time of sensor events (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ. - * It is truncated upto seconds if fraction is provided.
endDateTimeOffsetDateTimeNoSearch span end time of sensor events (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ. - * It is truncated upto seconds if fraction is provided.
excludeDuplicateEventsBooleanNoFlag to exclude duplicate events and take the latest ones only (Default: true).
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             sensorId: String (Optional)
-     *             sensorPartnerId: String (Optional)
-     *             partyId: String (Optional)
-     *             boundaryId: String (Optional)
-     *             eventDateTime: OffsetDateTime (Optional)
-     *             ingestionDateTime: OffsetDateTime (Optional)
-     *             measures (Optional): {
-     *                 String: Object (Optional)
-     *             }
-     *         }
-     *     ]
-     *     skipToken: String (Optional)
-     *     nextLink: String (Optional)
-     * }
-     * }
- * - * @param sensorId Id of the associated sensor. - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listWithResponse(String sensorId, String sensorPartnerId, - RequestOptions requestOptions) { - return this.serviceClient.listWithResponseAsync(sensorId, sensorPartnerId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorEventsClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorEventsClient.java deleted file mode 100644 index ec845fac3fe4..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorEventsClient.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = SensorEventsClientBuilder.class) -public final class SensorEventsClient { - @Generated - private final SensorEventsAsyncClient client; - - /** - * Initializes an instance of SensorEventsClient class. - * - * @param client the async client. - */ - @Generated - SensorEventsClient(SensorEventsAsyncClient client) { - this.client = client; - } - - /** - * Returns a list of sensor events data. Time span for query is limited to 90 days at a time. Returns last 90 days - * events when startDateTime and endDateTime are not provided. - * - *

Query Parameters - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
startDateTimeOffsetDateTimeNoSearch span start time of sensor events (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ. - * It is truncated upto seconds if fraction is provided.
endDateTimeOffsetDateTimeNoSearch span end time of sensor events (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ. - * It is truncated upto seconds if fraction is provided.
excludeDuplicateEventsBooleanNoFlag to exclude duplicate events and take the latest ones only (Default: true).
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             sensorId: String (Optional)
-     *             sensorPartnerId: String (Optional)
-     *             partyId: String (Optional)
-     *             boundaryId: String (Optional)
-     *             eventDateTime: OffsetDateTime (Optional)
-     *             ingestionDateTime: OffsetDateTime (Optional)
-     *             measures (Optional): {
-     *                 String: Object (Optional)
-     *             }
-     *         }
-     *     ]
-     *     skipToken: String (Optional)
-     *     nextLink: String (Optional)
-     * }
-     * }
- * - * @param sensorId Id of the associated sensor. - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String sensorId, String sensorPartnerId, - RequestOptions requestOptions) { - return this.client.listWithResponse(sensorId, sensorPartnerId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorEventsClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorEventsClientBuilder.java deleted file mode 100644 index c84558d3b9e4..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorEventsClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the SensorEventsClient type. */ -@ServiceClientBuilder(serviceClients = { SensorEventsClient.class, SensorEventsAsyncClient.class }) -public final class SensorEventsClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the SensorEventsClientBuilder. */ - @Generated - public SensorEventsClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorEventsClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorEventsClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorEventsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorEventsClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorEventsClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorEventsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorEventsClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorEventsClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorEventsClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the SensorEventsClientBuilder. - */ - @Generated - public SensorEventsClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the SensorEventsClientBuilder. - */ - @Generated - public SensorEventsClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of SensorEventsAsyncClient class. - * - * @return an instance of SensorEventsAsyncClient. - */ - @Generated - public SensorEventsAsyncClient buildAsyncClient() { - return new SensorEventsAsyncClient(buildInnerClient().getSensorEvents()); - } - - /** - * Builds an instance of SensorEventsClient class. - * - * @return an instance of SensorEventsClient. - */ - @Generated - public SensorEventsClient buildClient() { - return new SensorEventsClient(new SensorEventsAsyncClient(buildInnerClient().getSensorEvents())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorMappingsAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorMappingsAsyncClient.java deleted file mode 100644 index ea26f8103e9f..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorMappingsAsyncClient.java +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.verticals.agrifood.farming.implementation.SensorMappingsImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = SensorMappingsClientBuilder.class, isAsync = true) -public final class SensorMappingsAsyncClient { - @Generated - private final SensorMappingsImpl serviceClient; - - /** - * Initializes an instance of SensorMappingsAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - SensorMappingsAsyncClient(SensorMappingsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of sensor mapping resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
sensorIdsList<String>NoId of the sensors. Call {@link RequestOptions#addQueryParam} to add string to array.
sensorPartnerIdsList<String>NoId of the sensor partners. Call {@link RequestOptions#addQueryParam} to add string to array.
partyIdsList<String>NoId of the parties. Call {@link RequestOptions#addQueryParam} to add string to array.
boundaryIdsList<String>NoId of the boundaries. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     partyId: String (Optional)
-     *     boundaryId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(RequestOptions requestOptions) { - return this.serviceClient.listAsync(requestOptions); - } - - /** - * Create a sensor mapping entity. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     sensorId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     partyId: String (Optional)
-     *     boundaryId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     partyId: String (Optional)
-     *     boundaryId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorMappingId Id of the sensor mapping. - * @param sensorMappingObject Sensor mapping object details. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensorMapping API model along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String sensorMappingId, BinaryData sensorMappingObject, - RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(sensorMappingId, sensorMappingObject, requestOptions); - } - - /** - * Gets a sensor mapping entity. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     partyId: String (Optional)
-     *     boundaryId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorMappingId Id of the sensor mapping resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a sensor mapping entity along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String sensorMappingId, RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(sensorMappingId, requestOptions); - } - - /** - * Deletes a sensor mapping entity. - * - * @param sensorMappingId Id of the sensor mapping resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String sensorMappingId, RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(sensorMappingId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorMappingsClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorMappingsClient.java deleted file mode 100644 index 8918455396a6..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorMappingsClient.java +++ /dev/null @@ -1,222 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = SensorMappingsClientBuilder.class) -public final class SensorMappingsClient { - @Generated - private final SensorMappingsAsyncClient client; - - /** - * Initializes an instance of SensorMappingsClient class. - * - * @param client the async client. - */ - @Generated - SensorMappingsClient(SensorMappingsAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of sensor mapping resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
sensorIdsList<String>NoId of the sensors. Call {@link RequestOptions#addQueryParam} to add string to array.
sensorPartnerIdsList<String>NoId of the sensor partners. Call {@link RequestOptions#addQueryParam} to add string to array.
partyIdsList<String>NoId of the parties. Call {@link RequestOptions#addQueryParam} to add string to array.
boundaryIdsList<String>NoId of the boundaries. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     partyId: String (Optional)
-     *     boundaryId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(requestOptions)); - } - - /** - * Create a sensor mapping entity. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     sensorId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     partyId: String (Optional)
-     *     boundaryId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     partyId: String (Optional)
-     *     boundaryId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorMappingId Id of the sensor mapping. - * @param sensorMappingObject Sensor mapping object details. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensorMapping API model along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String sensorMappingId, BinaryData sensorMappingObject, - RequestOptions requestOptions) { - return this.client.createOrUpdateWithResponse(sensorMappingId, sensorMappingObject, requestOptions).block(); - } - - /** - * Gets a sensor mapping entity. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     partyId: String (Optional)
-     *     boundaryId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorMappingId Id of the sensor mapping resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a sensor mapping entity along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String sensorMappingId, RequestOptions requestOptions) { - return this.client.getWithResponse(sensorMappingId, requestOptions).block(); - } - - /** - * Deletes a sensor mapping entity. - * - * @param sensorMappingId Id of the sensor mapping resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String sensorMappingId, RequestOptions requestOptions) { - return this.client.deleteWithResponse(sensorMappingId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorMappingsClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorMappingsClientBuilder.java deleted file mode 100644 index 3448112ecf04..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorMappingsClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the SensorMappingsClient type. */ -@ServiceClientBuilder(serviceClients = { SensorMappingsClient.class, SensorMappingsAsyncClient.class }) -public final class SensorMappingsClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the SensorMappingsClientBuilder. */ - @Generated - public SensorMappingsClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorMappingsClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorMappingsClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorMappingsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorMappingsClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorMappingsClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorMappingsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorMappingsClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorMappingsClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorMappingsClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the SensorMappingsClientBuilder. - */ - @Generated - public SensorMappingsClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the SensorMappingsClientBuilder. - */ - @Generated - public SensorMappingsClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of SensorMappingsAsyncClient class. - * - * @return an instance of SensorMappingsAsyncClient. - */ - @Generated - public SensorMappingsAsyncClient buildAsyncClient() { - return new SensorMappingsAsyncClient(buildInnerClient().getSensorMappings()); - } - - /** - * Builds an instance of SensorMappingsClient class. - * - * @return an instance of SensorMappingsClient. - */ - @Generated - public SensorMappingsClient buildClient() { - return new SensorMappingsClient(new SensorMappingsAsyncClient(buildInnerClient().getSensorMappings())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorPartnerIntegrationsAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorPartnerIntegrationsAsyncClient.java deleted file mode 100644 index 6ec44aef89d5..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorPartnerIntegrationsAsyncClient.java +++ /dev/null @@ -1,284 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.verticals.agrifood.farming.implementation.SensorPartnerIntegrationsImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = SensorPartnerIntegrationsClientBuilder.class, isAsync = true) -public final class SensorPartnerIntegrationsAsyncClient { - @Generated - private final SensorPartnerIntegrationsImpl serviceClient; - - /** - * Initializes an instance of SensorPartnerIntegrationsAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - SensorPartnerIntegrationsAsyncClient(SensorPartnerIntegrationsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Gets partner integration models. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
integrationIdsList<String>NoIds of the partner integration models. Call {@link RequestOptions#addQueryParam} to add string to array.
partyIdsList<String>NoIds of the parties. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     integrationId: String (Optional)
-     *     partyId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return partner integration models as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(String sensorPartnerId, RequestOptions requestOptions) { - return this.serviceClient.listAsync(sensorPartnerId, requestOptions); - } - - /** - * Create or update an integration with a sensor partner. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     integrationId: String (Optional)
-     *     partyId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     integrationId: String (Optional)
-     *     partyId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param integrationId Id of the integration to be created. - * @param sensorPartnerIntegrationModel Partner integration model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensor partner integration model along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String sensorPartnerId, String integrationId, - BinaryData sensorPartnerIntegrationModel, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(sensorPartnerId, integrationId, - sensorPartnerIntegrationModel, requestOptions); - } - - /** - * Gets a partner integration model entity. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     integrationId: String (Optional)
-     *     partyId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param integrationId Id of the integration object. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a partner integration model entity along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String sensorPartnerId, String integrationId, - RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(sensorPartnerId, integrationId, requestOptions); - } - - /** - * Deletes a partner integration model entity. - * - * @param sensorPartnerId Id of the sensor partner. - * @param integrationId Id of the integration to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String sensorPartnerId, String integrationId, - RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(sensorPartnerId, integrationId, requestOptions); - } - - /** - * Checks consent for partner integration. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     consented: Boolean (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     integrationId: String (Optional)
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param integrationId Id of the integration object. - * @param key Partner integration key. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensor partner integration check consent response along with {@link Response} on successful completion of - * {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkConsentWithResponse(String sensorPartnerId, String integrationId, String key, - RequestOptions requestOptions) { - return this.serviceClient.checkConsentWithResponseAsync(sensorPartnerId, integrationId, key, requestOptions); - } - - /** - * Generates partner integration consent link. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     consentLink: String (Optional)
-     *     consentExpiryDateTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param integrationId Id of the integration object. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensor partner integration generate consent link response along with {@link Response} on successful - * completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> generateConsentLinkWithResponse(String sensorPartnerId, String integrationId, - RequestOptions requestOptions) { - return this.serviceClient.generateConsentLinkWithResponseAsync(sensorPartnerId, integrationId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorPartnerIntegrationsClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorPartnerIntegrationsClient.java deleted file mode 100644 index e518a018975f..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorPartnerIntegrationsClient.java +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = SensorPartnerIntegrationsClientBuilder.class) -public final class SensorPartnerIntegrationsClient { - @Generated - private final SensorPartnerIntegrationsAsyncClient client; - - /** - * Initializes an instance of SensorPartnerIntegrationsClient class. - * - * @param client the async client. - */ - @Generated - SensorPartnerIntegrationsClient(SensorPartnerIntegrationsAsyncClient client) { - this.client = client; - } - - /** - * Gets partner integration models. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
integrationIdsList<String>NoIds of the partner integration models. Call {@link RequestOptions#addQueryParam} to add string to array.
partyIdsList<String>NoIds of the parties. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     integrationId: String (Optional)
-     *     partyId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return partner integration models as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String sensorPartnerId, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(sensorPartnerId, requestOptions)); - } - - /** - * Create or update an integration with a sensor partner. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     integrationId: String (Optional)
-     *     partyId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     integrationId: String (Optional)
-     *     partyId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param integrationId Id of the integration to be created. - * @param sensorPartnerIntegrationModel Partner integration model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensor partner integration model along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String sensorPartnerId, String integrationId, - BinaryData sensorPartnerIntegrationModel, RequestOptions requestOptions) { - return this.client - .createOrUpdateWithResponse(sensorPartnerId, integrationId, sensorPartnerIntegrationModel, requestOptions) - .block(); - } - - /** - * Gets a partner integration model entity. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     integrationId: String (Optional)
-     *     partyId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param integrationId Id of the integration object. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a partner integration model entity along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String sensorPartnerId, String integrationId, - RequestOptions requestOptions) { - return this.client.getWithResponse(sensorPartnerId, integrationId, requestOptions).block(); - } - - /** - * Deletes a partner integration model entity. - * - * @param sensorPartnerId Id of the sensor partner. - * @param integrationId Id of the integration to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String sensorPartnerId, String integrationId, - RequestOptions requestOptions) { - return this.client.deleteWithResponse(sensorPartnerId, integrationId, requestOptions).block(); - } - - /** - * Checks consent for partner integration. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     consented: Boolean (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     integrationId: String (Optional)
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param integrationId Id of the integration object. - * @param key Partner integration key. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensor partner integration check consent response along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkConsentWithResponse(String sensorPartnerId, String integrationId, String key, - RequestOptions requestOptions) { - return this.client.checkConsentWithResponse(sensorPartnerId, integrationId, key, requestOptions).block(); - } - - /** - * Generates partner integration consent link. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     consentLink: String (Optional)
-     *     consentExpiryDateTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param integrationId Id of the integration object. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensor partner integration generate consent link response along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response generateConsentLinkWithResponse(String sensorPartnerId, String integrationId, - RequestOptions requestOptions) { - return this.client.generateConsentLinkWithResponse(sensorPartnerId, integrationId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorPartnerIntegrationsClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorPartnerIntegrationsClientBuilder.java deleted file mode 100644 index 84b9b7bf2e45..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorPartnerIntegrationsClientBuilder.java +++ /dev/null @@ -1,305 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the SensorPartnerIntegrationsClient type. */ -@ServiceClientBuilder( - serviceClients = { SensorPartnerIntegrationsClient.class, SensorPartnerIntegrationsAsyncClient.class }) -public final class SensorPartnerIntegrationsClientBuilder implements HttpTrait, - ConfigurationTrait, - TokenCredentialTrait, - EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the SensorPartnerIntegrationsClientBuilder. */ - @Generated - public SensorPartnerIntegrationsClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorPartnerIntegrationsClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorPartnerIntegrationsClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorPartnerIntegrationsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorPartnerIntegrationsClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorPartnerIntegrationsClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorPartnerIntegrationsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorPartnerIntegrationsClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorPartnerIntegrationsClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorPartnerIntegrationsClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the SensorPartnerIntegrationsClientBuilder. - */ - @Generated - public SensorPartnerIntegrationsClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the SensorPartnerIntegrationsClientBuilder. - */ - @Generated - public SensorPartnerIntegrationsClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of SensorPartnerIntegrationsAsyncClient class. - * - * @return an instance of SensorPartnerIntegrationsAsyncClient. - */ - @Generated - public SensorPartnerIntegrationsAsyncClient buildAsyncClient() { - return new SensorPartnerIntegrationsAsyncClient(buildInnerClient().getSensorPartnerIntegrations()); - } - - /** - * Builds an instance of SensorPartnerIntegrationsClient class. - * - * @return an instance of SensorPartnerIntegrationsClient. - */ - @Generated - public SensorPartnerIntegrationsClient buildClient() { - return new SensorPartnerIntegrationsClient( - new SensorPartnerIntegrationsAsyncClient(buildInnerClient().getSensorPartnerIntegrations())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorsAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorsAsyncClient.java deleted file mode 100644 index fff43347b1e3..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorsAsyncClient.java +++ /dev/null @@ -1,349 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.verticals.agrifood.farming.implementation.SensorsImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = SensorsClientBuilder.class, isAsync = true) -public final class SensorsAsyncClient { - @Generated - private final SensorsImpl serviceClient; - - /** - * Initializes an instance of SensorsAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - SensorsAsyncClient(SensorsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of sensor resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
sensorDataModelIdsList<String>NoId's of the sensor data models. Call {@link RequestOptions#addQueryParam} to add string to array.
sensorMappingIdsList<String>NoIds of the sensor mappings. Call {@link RequestOptions#addQueryParam} to add string to array.
deviceIdsList<String>NoId's of the devices. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     hardwareId: String (Optional)
-     *     deviceId: String (Optional)
-     *     type: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     port (Optional): {
-     *         name: String (Optional)
-     *         type: String (Optional)
-     *     }
-     *     depthInMeters (Optional): [
-     *         double (Optional)
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(String sensorPartnerId, RequestOptions requestOptions) { - return this.serviceClient.listAsync(sensorPartnerId, requestOptions); - } - - /** - * Create a sensor entity. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     sensorDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     hardwareId: String (Optional)
-     *     deviceId: String (Optional)
-     *     type: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     port (Optional): {
-     *         name: String (Optional)
-     *         type: String (Optional)
-     *     }
-     *     depthInMeters (Optional): [
-     *         double (Optional)
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     hardwareId: String (Optional)
-     *     deviceId: String (Optional)
-     *     type: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     port (Optional): {
-     *         name: String (Optional)
-     *         type: String (Optional)
-     *     }
-     *     depthInMeters (Optional): [
-     *         double (Optional)
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorId Id of the sensor resource. - * @param sensorDetails Sensor object details. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensor API model along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String sensorPartnerId, String sensorId, - BinaryData sensorDetails, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(sensorPartnerId, sensorId, sensorDetails, - requestOptions); - } - - /** - * Gets a sensor entity. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     hardwareId: String (Optional)
-     *     deviceId: String (Optional)
-     *     type: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     port (Optional): {
-     *         name: String (Optional)
-     *         type: String (Optional)
-     *     }
-     *     depthInMeters (Optional): [
-     *         double (Optional)
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorId Id of the sensor resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a sensor entity along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String sensorPartnerId, String sensorId, - RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(sensorPartnerId, sensorId, requestOptions); - } - - /** - * Deletes a sensor entity. - * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorId Id of the sensor resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String sensorPartnerId, String sensorId, - RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(sensorPartnerId, sensorId, requestOptions); - } - - /** - * Gets a sensor connection string. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     primaryDeviceConnectionString: String (Optional)
-     *     secondaryDeviceConnectionString: String (Optional)
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorId Id of the sensor resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a sensor connection string along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getConnectionStringWithResponse(String sensorPartnerId, String sensorId, - RequestOptions requestOptions) { - return this.serviceClient.getConnectionStringWithResponseAsync(sensorPartnerId, sensorId, requestOptions); - } - - /** - * Renews a sensor connection string. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     connectionStringType: String(Primary/Secondary/Both) (Required)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     primaryDeviceConnectionString: String (Optional)
-     *     secondaryDeviceConnectionString: String (Optional)
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorId Id of the sensor resource. - * @param renewConnectionStringModel Sensor's connection string model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return authentication via connection string to IoTHub devices along with {@link Response} on successful - * completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> renewConnectionStringWithResponse(String sensorPartnerId, String sensorId, - BinaryData renewConnectionStringModel, RequestOptions requestOptions) { - return this.serviceClient.renewConnectionStringWithResponseAsync(sensorPartnerId, sensorId, - renewConnectionStringModel, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorsClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorsClient.java deleted file mode 100644 index 7d3e70476798..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorsClient.java +++ /dev/null @@ -1,345 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = SensorsClientBuilder.class) -public final class SensorsClient { - @Generated - private final SensorsAsyncClient client; - - /** - * Initializes an instance of SensorsClient class. - * - * @param client the async client. - */ - @Generated - SensorsClient(SensorsAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of sensor resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
sensorDataModelIdsList<String>NoId's of the sensor data models. Call {@link RequestOptions#addQueryParam} to add string to array.
sensorMappingIdsList<String>NoIds of the sensor mappings. Call {@link RequestOptions#addQueryParam} to add string to array.
deviceIdsList<String>NoId's of the devices. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     hardwareId: String (Optional)
-     *     deviceId: String (Optional)
-     *     type: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     port (Optional): {
-     *         name: String (Optional)
-     *         type: String (Optional)
-     *     }
-     *     depthInMeters (Optional): [
-     *         double (Optional)
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String sensorPartnerId, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(sensorPartnerId, requestOptions)); - } - - /** - * Create a sensor entity. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     sensorDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     hardwareId: String (Optional)
-     *     deviceId: String (Optional)
-     *     type: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     port (Optional): {
-     *         name: String (Optional)
-     *         type: String (Optional)
-     *     }
-     *     depthInMeters (Optional): [
-     *         double (Optional)
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     hardwareId: String (Optional)
-     *     deviceId: String (Optional)
-     *     type: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     port (Optional): {
-     *         name: String (Optional)
-     *         type: String (Optional)
-     *     }
-     *     depthInMeters (Optional): [
-     *         double (Optional)
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorId Id of the sensor resource. - * @param sensorDetails Sensor object details. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensor API model along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String sensorPartnerId, String sensorId, - BinaryData sensorDetails, RequestOptions requestOptions) { - return this.client.createOrUpdateWithResponse(sensorPartnerId, sensorId, sensorDetails, requestOptions).block(); - } - - /** - * Gets a sensor entity. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     hardwareId: String (Optional)
-     *     deviceId: String (Optional)
-     *     type: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     port (Optional): {
-     *         name: String (Optional)
-     *         type: String (Optional)
-     *     }
-     *     depthInMeters (Optional): [
-     *         double (Optional)
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorId Id of the sensor resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a sensor entity along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String sensorPartnerId, String sensorId, - RequestOptions requestOptions) { - return this.client.getWithResponse(sensorPartnerId, sensorId, requestOptions).block(); - } - - /** - * Deletes a sensor entity. - * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorId Id of the sensor resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String sensorPartnerId, String sensorId, RequestOptions requestOptions) { - return this.client.deleteWithResponse(sensorPartnerId, sensorId, requestOptions).block(); - } - - /** - * Gets a sensor connection string. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     primaryDeviceConnectionString: String (Optional)
-     *     secondaryDeviceConnectionString: String (Optional)
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorId Id of the sensor resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a sensor connection string along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getConnectionStringWithResponse(String sensorPartnerId, String sensorId, - RequestOptions requestOptions) { - return this.client.getConnectionStringWithResponse(sensorPartnerId, sensorId, requestOptions).block(); - } - - /** - * Renews a sensor connection string. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     connectionStringType: String(Primary/Secondary/Both) (Required)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     primaryDeviceConnectionString: String (Optional)
-     *     secondaryDeviceConnectionString: String (Optional)
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorId Id of the sensor resource. - * @param renewConnectionStringModel Sensor's connection string model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return authentication via connection string to IoTHub devices along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response renewConnectionStringWithResponse(String sensorPartnerId, String sensorId, - BinaryData renewConnectionStringModel, RequestOptions requestOptions) { - return this.client - .renewConnectionStringWithResponse(sensorPartnerId, sensorId, renewConnectionStringModel, requestOptions) - .block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorsClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorsClientBuilder.java deleted file mode 100644 index 28eff253c0b1..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SensorsClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the SensorsClient type. */ -@ServiceClientBuilder(serviceClients = { SensorsClient.class, SensorsAsyncClient.class }) -public final class SensorsClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the SensorsClientBuilder. */ - @Generated - public SensorsClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorsClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorsClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorsClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorsClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorsClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorsClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public SensorsClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the SensorsClientBuilder. - */ - @Generated - public SensorsClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the SensorsClientBuilder. - */ - @Generated - public SensorsClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of SensorsAsyncClient class. - * - * @return an instance of SensorsAsyncClient. - */ - @Generated - public SensorsAsyncClient buildAsyncClient() { - return new SensorsAsyncClient(buildInnerClient().getSensors()); - } - - /** - * Builds an instance of SensorsClient class. - * - * @return an instance of SensorsClient. - */ - @Generated - public SensorsClient buildClient() { - return new SensorsClient(new SensorsAsyncClient(buildInnerClient().getSensors())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SolutionInferenceAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SolutionInferenceAsyncClient.java deleted file mode 100644 index 7e62c3a7d659..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SolutionInferenceAsyncClient.java +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollerFlux; -import com.azure.verticals.agrifood.farming.implementation.SolutionInferencesImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = SolutionInferenceClientBuilder.class, isAsync = true) -public final class SolutionInferenceAsyncClient { - @Generated - private final SolutionInferencesImpl serviceClient; - - /** - * Initializes an instance of SolutionInferenceAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - SolutionInferenceAsyncClient(SolutionInferencesImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Cancels a job for given solution id. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     requestPath: String (Required)
-     *     partnerRequestBody (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     String: Object (Required)
-     * }
-     * }
- * - * @param solutionId Id of solution for which job is to be cancelled. - * @param solutionInferenceRequest solutionInferenceRequest containing input needed for job request processing. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return dictionary of <any> along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> cancelWithResponse(String solutionId, BinaryData solutionInferenceRequest, - RequestOptions requestOptions) { - return this.serviceClient.cancelWithResponseAsync(solutionId, solutionInferenceRequest, requestOptions); - } - - /** - * Creates a job trigger for a solution. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     requestPath: String (Required)
-     *     partnerRequestBody (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     String: Object (Required)
-     * }
-     * }
- * - * @param solutionId Id of the solution resource. - * @param solutionInferenceRequest solutionInferenceRequest containing input needed for job request processing. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of dictionary of <any>. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateOrUpdate(String solutionId, - BinaryData solutionInferenceRequest, RequestOptions requestOptions) { - return this.serviceClient.beginCreateOrUpdateAsync(solutionId, solutionInferenceRequest, requestOptions); - } - - /** - * Fetches details of triggered job for a solution. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     requestPath: String (Required)
-     *     partnerRequestBody (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     String: Object (Required)
-     * }
-     * }
- * - * @param solutionId Id of the solution. - * @param solutionInferenceRequest solutionInferenceRequest containing input needed for job request processing. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return dictionary of <any> along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> fetchWithResponse(String solutionId, BinaryData solutionInferenceRequest, - RequestOptions requestOptions) { - return this.serviceClient.fetchWithResponseAsync(solutionId, solutionInferenceRequest, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SolutionInferenceClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SolutionInferenceClient.java deleted file mode 100644 index b82436d6d37e..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SolutionInferenceClient.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.SyncPoller; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = SolutionInferenceClientBuilder.class) -public final class SolutionInferenceClient { - @Generated - private final SolutionInferenceAsyncClient client; - - /** - * Initializes an instance of SolutionInferenceClient class. - * - * @param client the async client. - */ - @Generated - SolutionInferenceClient(SolutionInferenceAsyncClient client) { - this.client = client; - } - - /** - * Cancels a job for given solution id. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     requestPath: String (Required)
-     *     partnerRequestBody (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     String: Object (Required)
-     * }
-     * }
- * - * @param solutionId Id of solution for which job is to be cancelled. - * @param solutionInferenceRequest solutionInferenceRequest containing input needed for job request processing. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return dictionary of <any> along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelWithResponse(String solutionId, BinaryData solutionInferenceRequest, - RequestOptions requestOptions) { - return this.client.cancelWithResponse(solutionId, solutionInferenceRequest, requestOptions).block(); - } - - /** - * Creates a job trigger for a solution. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     requestPath: String (Required)
-     *     partnerRequestBody (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     String: Object (Required)
-     * }
-     * }
- * - * @param solutionId Id of the solution resource. - * @param solutionInferenceRequest solutionInferenceRequest containing input needed for job request processing. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of dictionary of <any>. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateOrUpdate(String solutionId, - BinaryData solutionInferenceRequest, RequestOptions requestOptions) { - return this.client.beginCreateOrUpdate(solutionId, solutionInferenceRequest, requestOptions).getSyncPoller(); - } - - /** - * Fetches details of triggered job for a solution. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     requestPath: String (Required)
-     *     partnerRequestBody (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     String: Object (Required)
-     * }
-     * }
- * - * @param solutionId Id of the solution. - * @param solutionInferenceRequest solutionInferenceRequest containing input needed for job request processing. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return dictionary of <any> along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response fetchWithResponse(String solutionId, BinaryData solutionInferenceRequest, - RequestOptions requestOptions) { - return this.client.fetchWithResponse(solutionId, solutionInferenceRequest, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SolutionInferenceClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SolutionInferenceClientBuilder.java deleted file mode 100644 index 87c3c6e5d604..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/SolutionInferenceClientBuilder.java +++ /dev/null @@ -1,303 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the SolutionInferenceClient type. */ -@ServiceClientBuilder(serviceClients = { SolutionInferenceClient.class, SolutionInferenceAsyncClient.class }) -public final class SolutionInferenceClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the SolutionInferenceClientBuilder. */ - @Generated - public SolutionInferenceClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public SolutionInferenceClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public SolutionInferenceClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public SolutionInferenceClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public SolutionInferenceClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public SolutionInferenceClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public SolutionInferenceClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public SolutionInferenceClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public SolutionInferenceClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public SolutionInferenceClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the SolutionInferenceClientBuilder. - */ - @Generated - public SolutionInferenceClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the SolutionInferenceClientBuilder. - */ - @Generated - public SolutionInferenceClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of SolutionInferenceAsyncClient class. - * - * @return an instance of SolutionInferenceAsyncClient. - */ - @Generated - public SolutionInferenceAsyncClient buildAsyncClient() { - return new SolutionInferenceAsyncClient(buildInnerClient().getSolutionInferences()); - } - - /** - * Builds an instance of SolutionInferenceClient class. - * - * @return an instance of SolutionInferenceClient. - */ - @Generated - public SolutionInferenceClient buildClient() { - return new SolutionInferenceClient( - new SolutionInferenceAsyncClient(buildInnerClient().getSolutionInferences())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/TillageDataAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/TillageDataAsyncClient.java deleted file mode 100644 index 1d612af3bc24..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/TillageDataAsyncClient.java +++ /dev/null @@ -1,439 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollerFlux; -import com.azure.verticals.agrifood.farming.implementation.TillageDatasImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = TillageDataClientBuilder.class, isAsync = true) -public final class TillageDataAsyncClient { - @Generated - private final TillageDatasImpl serviceClient; - - /** - * Initializes an instance of TillageDataAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - TillageDataAsyncClient(TillageDatasImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of tillage data resources under a particular farm. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minTillageDepthDoubleNoMinimum measured tillage depth (inclusive).
maxTillageDepthDoubleNoMaximum measured tillage depth (inclusive).
minTillagePressureDoubleNoMinimum pressure applied to a tillage implement (inclusive).
maxTillagePressureDoubleNoMaximum pressure applied to a tillage implement (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     tillageDepth (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     tillagePressure (Optional): (recursive schema, see tillagePressure above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyId(String partyId, RequestOptions requestOptions) { - return this.serviceClient.listByPartyIdAsync(partyId, requestOptions); - } - - /** - * Get a specified tillage data resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     tillageDepth (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     tillagePressure (Optional): (recursive schema, see tillagePressure above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party resource. - * @param tillageDataId ID of the tillage data resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified tillage data resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String partyId, String tillageDataId, - RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(partyId, tillageDataId, requestOptions); - } - - /** - * Creates or updates an tillage data resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     tillageDepth (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     tillagePressure (Optional): (recursive schema, see tillagePressure above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     tillageDepth (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     tillagePressure (Optional): (recursive schema, see tillagePressure above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param tillageDataId ID of the tillage data resource. - * @param tillageData Tillage data resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of tillage data resource along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String partyId, String tillageDataId, - BinaryData tillageData, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(partyId, tillageDataId, tillageData, requestOptions); - } - - /** - * Deletes a specified tillage data resource under a particular party. - * - * @param partyId ID of the associated party resource. - * @param tillageDataId ID of the tillage data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String partyId, String tillageDataId, - RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(partyId, tillageDataId, requestOptions); - } - - /** - * Returns a paginated list of tillage data resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minTillageDepthDoubleNoMinimum measured tillage depth (inclusive).
maxTillageDepthDoubleNoMaximum measured tillage depth (inclusive).
minTillagePressureDoubleNoMinimum pressure applied to a tillage implement (inclusive).
maxTillagePressureDoubleNoMaximum pressure applied to a tillage implement (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     tillageDepth (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     tillagePressure (Optional): (recursive schema, see tillagePressure above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(RequestOptions requestOptions) { - return this.serviceClient.listAsync(requestOptions); - } - - /** - * Create cascade delete job for tillage data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param partyId Id of the party. - * @param tillageDataId Id of the tillage data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJob(String jobId, String partyId, - String tillageDataId, RequestOptions requestOptions) { - return this.serviceClient.beginCreateCascadeDeleteJobAsync(jobId, partyId, tillageDataId, requestOptions); - } - - /** - * Get cascade delete job for tillage data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for tillage data resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponse(String jobId, - RequestOptions requestOptions) { - return this.serviceClient.getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/TillageDataClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/TillageDataClient.java deleted file mode 100644 index 12cb5b8abbb7..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/TillageDataClient.java +++ /dev/null @@ -1,432 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.SyncPoller; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = TillageDataClientBuilder.class) -public final class TillageDataClient { - @Generated - private final TillageDataAsyncClient client; - - /** - * Initializes an instance of TillageDataClient class. - * - * @param client the async client. - */ - @Generated - TillageDataClient(TillageDataAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of tillage data resources under a particular farm. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minTillageDepthDoubleNoMinimum measured tillage depth (inclusive).
maxTillageDepthDoubleNoMaximum measured tillage depth (inclusive).
minTillagePressureDoubleNoMinimum pressure applied to a tillage implement (inclusive).
maxTillagePressureDoubleNoMaximum pressure applied to a tillage implement (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     tillageDepth (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     tillagePressure (Optional): (recursive schema, see tillagePressure above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listByPartyId(partyId, requestOptions)); - } - - /** - * Get a specified tillage data resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     tillageDepth (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     tillagePressure (Optional): (recursive schema, see tillagePressure above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party resource. - * @param tillageDataId ID of the tillage data resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified tillage data resource under a particular party along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String tillageDataId, RequestOptions requestOptions) { - return this.client.getWithResponse(partyId, tillageDataId, requestOptions).block(); - } - - /** - * Creates or updates an tillage data resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     tillageDepth (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     tillagePressure (Optional): (recursive schema, see tillagePressure above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     tillageDepth (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     tillagePressure (Optional): (recursive schema, see tillagePressure above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param tillageDataId ID of the tillage data resource. - * @param tillageData Tillage data resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of tillage data resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String tillageDataId, BinaryData tillageData, - RequestOptions requestOptions) { - return this.client.createOrUpdateWithResponse(partyId, tillageDataId, tillageData, requestOptions).block(); - } - - /** - * Deletes a specified tillage data resource under a particular party. - * - * @param partyId ID of the associated party resource. - * @param tillageDataId ID of the tillage data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String tillageDataId, RequestOptions requestOptions) { - return this.client.deleteWithResponse(partyId, tillageDataId, requestOptions).block(); - } - - /** - * Returns a paginated list of tillage data resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minTillageDepthDoubleNoMinimum measured tillage depth (inclusive).
maxTillageDepthDoubleNoMaximum measured tillage depth (inclusive).
minTillagePressureDoubleNoMinimum pressure applied to a tillage implement (inclusive).
maxTillagePressureDoubleNoMaximum pressure applied to a tillage implement (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     tillageDepth (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     tillagePressure (Optional): (recursive schema, see tillagePressure above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(requestOptions)); - } - - /** - * Create cascade delete job for tillage data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param partyId Id of the party. - * @param tillageDataId Id of the tillage data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, - String tillageDataId, RequestOptions requestOptions) { - return this.client.beginCreateCascadeDeleteJob(jobId, partyId, tillageDataId, requestOptions).getSyncPoller(); - } - - /** - * Get cascade delete job for tillage data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for tillage data resource along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return this.client.getCascadeDeleteJobDetailsWithResponse(jobId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/TillageDataClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/TillageDataClientBuilder.java deleted file mode 100644 index 0f63e9f061da..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/TillageDataClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the TillageDataClient type. */ -@ServiceClientBuilder(serviceClients = { TillageDataClient.class, TillageDataAsyncClient.class }) -public final class TillageDataClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the TillageDataClientBuilder. */ - @Generated - public TillageDataClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public TillageDataClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public TillageDataClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public TillageDataClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public TillageDataClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public TillageDataClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public TillageDataClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public TillageDataClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public TillageDataClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public TillageDataClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the TillageDataClientBuilder. - */ - @Generated - public TillageDataClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the TillageDataClientBuilder. - */ - @Generated - public TillageDataClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of TillageDataAsyncClient class. - * - * @return an instance of TillageDataAsyncClient. - */ - @Generated - public TillageDataAsyncClient buildAsyncClient() { - return new TillageDataAsyncClient(buildInnerClient().getTillageDatas()); - } - - /** - * Builds an instance of TillageDataClient class. - * - * @return an instance of TillageDataClient. - */ - @Generated - public TillageDataClient buildClient() { - return new TillageDataClient(new TillageDataAsyncClient(buildInnerClient().getTillageDatas())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/WeatherAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/WeatherAsyncClient.java deleted file mode 100644 index 497477440ebc..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/WeatherAsyncClient.java +++ /dev/null @@ -1,379 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollerFlux; -import com.azure.verticals.agrifood.farming.implementation.WeathersImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = WeatherClientBuilder.class, isAsync = true) -public final class WeatherAsyncClient { - @Generated - private final WeathersImpl serviceClient; - - /** - * Initializes an instance of WeatherAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - WeatherAsyncClient(WeathersImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of weather data. - * - *

Query Parameters - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
startDateTimeOffsetDateTimeNoWeather data start UTC date-time (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
endDateTimeOffsetDateTimeNoWeather data end UTC date-time (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     extensionId: String (Required)
-     *     location (Required): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     dateTime: OffsetDateTime (Required)
-     *     unitSystemCode: String (Optional)
-     *     extensionVersion: String (Required)
-     *     weatherDataType: String (Required)
-     *     granularity: String (Required)
-     *     cloudCover (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     dewPoint (Optional): (recursive schema, see dewPoint above)
-     *     growingDegreeDay (Optional): (recursive schema, see growingDegreeDay above)
-     *     precipitation (Optional): (recursive schema, see precipitation above)
-     *     pressure (Optional): (recursive schema, see pressure above)
-     *     relativeHumidity (Optional): (recursive schema, see relativeHumidity above)
-     *     soilMoisture (Optional): (recursive schema, see soilMoisture above)
-     *     soilTemperature (Optional): (recursive schema, see soilTemperature above)
-     *     temperature (Optional): (recursive schema, see temperature above)
-     *     visibility (Optional): (recursive schema, see visibility above)
-     *     wetBulbTemperature (Optional): (recursive schema, see wetBulbTemperature above)
-     *     windChill (Optional): (recursive schema, see windChill above)
-     *     windDirection (Optional): (recursive schema, see windDirection above)
-     *     windGust (Optional): (recursive schema, see windGust above)
-     *     windSpeed (Optional): (recursive schema, see windSpeed above)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Party ID. - * @param boundaryId Boundary ID. - * @param extensionId ID of the weather extension. - * @param weatherDataType Type of weather data (forecast/historical). - * @param granularity Granularity of weather data (daily/hourly). - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(String partyId, String boundaryId, String extensionId, String weatherDataType, - String granularity, RequestOptions requestOptions) { - return this.serviceClient.listAsync(partyId, boundaryId, extensionId, weatherDataType, granularity, - requestOptions); - } - - /** - * Get weather data delete job. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     extensionId: String (Required)
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     weatherDataType: String (Optional)
-     *     granularity: String (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return weather data delete job along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDataDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return this.serviceClient.getDataDeleteJobDetailsWithResponseAsync(jobId, requestOptions); - } - - /** - * Create a weather data delete job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     extensionId: String (Required)
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     weatherDataType: String (Optional)
-     *     granularity: String (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     extensionId: String (Required)
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     weatherDataType: String (Optional)
-     *     granularity: String (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of weather data delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateDataDeleteJob(String jobId, BinaryData job, - RequestOptions requestOptions) { - return this.serviceClient.beginCreateDataDeleteJobAsync(jobId, job, requestOptions); - } - - /** - * Get weather ingestion job. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     boundaryId: String (Required)
-     *     partyId: String (Required)
-     *     extensionId: String (Required)
-     *     extensionApiName: String (Required)
-     *     extensionApiInput (Required): {
-     *         String: Object (Required)
-     *     }
-     *     extensionDataProviderAppId: String (Optional)
-     *     extensionDataProviderApiKey: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return weather ingestion job along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDataIngestionJobDetailsWithResponse(String jobId, - RequestOptions requestOptions) { - return this.serviceClient.getDataIngestionJobDetailsWithResponseAsync(jobId, requestOptions); - } - - /** - * Create a weather data ingestion job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     boundaryId: String (Required)
-     *     partyId: String (Required)
-     *     extensionId: String (Required)
-     *     extensionApiName: String (Required)
-     *     extensionApiInput (Required): {
-     *         String: Object (Required)
-     *     }
-     *     extensionDataProviderAppId: String (Optional)
-     *     extensionDataProviderApiKey: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     boundaryId: String (Required)
-     *     partyId: String (Required)
-     *     extensionId: String (Required)
-     *     extensionApiName: String (Required)
-     *     extensionApiInput (Required): {
-     *         String: Object (Required)
-     *     }
-     *     extensionDataProviderAppId: String (Optional)
-     *     extensionDataProviderApiKey: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Job id supplied by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of weather ingestion job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateDataIngestionJob(String jobId, BinaryData job, - RequestOptions requestOptions) { - return this.serviceClient.beginCreateDataIngestionJobAsync(jobId, job, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/WeatherClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/WeatherClient.java deleted file mode 100644 index 532f3aa3909f..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/WeatherClient.java +++ /dev/null @@ -1,376 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.SyncPoller; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = WeatherClientBuilder.class) -public final class WeatherClient { - @Generated - private final WeatherAsyncClient client; - - /** - * Initializes an instance of WeatherClient class. - * - * @param client the async client. - */ - @Generated - WeatherClient(WeatherAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of weather data. - * - *

Query Parameters - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
startDateTimeOffsetDateTimeNoWeather data start UTC date-time (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
endDateTimeOffsetDateTimeNoWeather data end UTC date-time (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     extensionId: String (Required)
-     *     location (Required): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     dateTime: OffsetDateTime (Required)
-     *     unitSystemCode: String (Optional)
-     *     extensionVersion: String (Required)
-     *     weatherDataType: String (Required)
-     *     granularity: String (Required)
-     *     cloudCover (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     dewPoint (Optional): (recursive schema, see dewPoint above)
-     *     growingDegreeDay (Optional): (recursive schema, see growingDegreeDay above)
-     *     precipitation (Optional): (recursive schema, see precipitation above)
-     *     pressure (Optional): (recursive schema, see pressure above)
-     *     relativeHumidity (Optional): (recursive schema, see relativeHumidity above)
-     *     soilMoisture (Optional): (recursive schema, see soilMoisture above)
-     *     soilTemperature (Optional): (recursive schema, see soilTemperature above)
-     *     temperature (Optional): (recursive schema, see temperature above)
-     *     visibility (Optional): (recursive schema, see visibility above)
-     *     wetBulbTemperature (Optional): (recursive schema, see wetBulbTemperature above)
-     *     windChill (Optional): (recursive schema, see windChill above)
-     *     windDirection (Optional): (recursive schema, see windDirection above)
-     *     windGust (Optional): (recursive schema, see windGust above)
-     *     windSpeed (Optional): (recursive schema, see windSpeed above)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Party ID. - * @param boundaryId Boundary ID. - * @param extensionId ID of the weather extension. - * @param weatherDataType Type of weather data (forecast/historical). - * @param granularity Granularity of weather data (daily/hourly). - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String partyId, String boundaryId, String extensionId, String weatherDataType, - String granularity, RequestOptions requestOptions) { - return new PagedIterable<>( - this.client.list(partyId, boundaryId, extensionId, weatherDataType, granularity, requestOptions)); - } - - /** - * Get weather data delete job. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     extensionId: String (Required)
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     weatherDataType: String (Optional)
-     *     granularity: String (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return weather data delete job along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDataDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return this.client.getDataDeleteJobDetailsWithResponse(jobId, requestOptions).block(); - } - - /** - * Create a weather data delete job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     extensionId: String (Required)
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     weatherDataType: String (Optional)
-     *     granularity: String (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     extensionId: String (Required)
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     weatherDataType: String (Optional)
-     *     granularity: String (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of weather data delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateDataDeleteJob(String jobId, BinaryData job, - RequestOptions requestOptions) { - return this.client.beginCreateDataDeleteJob(jobId, job, requestOptions).getSyncPoller(); - } - - /** - * Get weather ingestion job. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     boundaryId: String (Required)
-     *     partyId: String (Required)
-     *     extensionId: String (Required)
-     *     extensionApiName: String (Required)
-     *     extensionApiInput (Required): {
-     *         String: Object (Required)
-     *     }
-     *     extensionDataProviderAppId: String (Optional)
-     *     extensionDataProviderApiKey: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return weather ingestion job along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDataIngestionJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return this.client.getDataIngestionJobDetailsWithResponse(jobId, requestOptions).block(); - } - - /** - * Create a weather data ingestion job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     boundaryId: String (Required)
-     *     partyId: String (Required)
-     *     extensionId: String (Required)
-     *     extensionApiName: String (Required)
-     *     extensionApiInput (Required): {
-     *         String: Object (Required)
-     *     }
-     *     extensionDataProviderAppId: String (Optional)
-     *     extensionDataProviderApiKey: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     boundaryId: String (Required)
-     *     partyId: String (Required)
-     *     extensionId: String (Required)
-     *     extensionApiName: String (Required)
-     *     extensionApiInput (Required): {
-     *         String: Object (Required)
-     *     }
-     *     extensionDataProviderAppId: String (Optional)
-     *     extensionDataProviderApiKey: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Job id supplied by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of weather ingestion job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateDataIngestionJob(String jobId, BinaryData job, - RequestOptions requestOptions) { - return this.client.beginCreateDataIngestionJob(jobId, job, requestOptions).getSyncPoller(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/WeatherClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/WeatherClientBuilder.java deleted file mode 100644 index f1004334c233..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/WeatherClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the WeatherClient type. */ -@ServiceClientBuilder(serviceClients = { WeatherClient.class, WeatherAsyncClient.class }) -public final class WeatherClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the WeatherClientBuilder. */ - @Generated - public WeatherClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public WeatherClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public WeatherClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public WeatherClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public WeatherClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public WeatherClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public WeatherClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public WeatherClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public WeatherClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public WeatherClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the WeatherClientBuilder. - */ - @Generated - public WeatherClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the WeatherClientBuilder. - */ - @Generated - public WeatherClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of WeatherAsyncClient class. - * - * @return an instance of WeatherAsyncClient. - */ - @Generated - public WeatherAsyncClient buildAsyncClient() { - return new WeatherAsyncClient(buildInnerClient().getWeathers()); - } - - /** - * Builds an instance of WeatherClient class. - * - * @return an instance of WeatherClient. - */ - @Generated - public WeatherClient buildClient() { - return new WeatherClient(new WeatherAsyncClient(buildInnerClient().getWeathers())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/WeatherDataAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/WeatherDataAsyncClient.java deleted file mode 100644 index 6ec9ea335ddf..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/WeatherDataAsyncClient.java +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.verticals.agrifood.farming.implementation.WeatherDatasImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = WeatherDataClientBuilder.class, isAsync = true) -public final class WeatherDataAsyncClient { - @Generated - private final WeatherDatasImpl serviceClient; - - /** - * Initializes an instance of WeatherDataAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - WeatherDataAsyncClient(WeatherDatasImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a list of WeatherData. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     locations (Optional): [
-     *          (Optional){
-     *             type: String(LatLong/IataCode/IcaoCode/PlaceId/PostalKey) (Required)
-     *             value: String (Required)
-     *         }
-     *     ]
-     *     providerAppId: String (Optional)
-     *     providerApiKey: String (Required)
-     *     extensionId: String (Required)
-     *     extensionApiName: String (Required)
-     *     language: String (Optional)
-     *     startTimeHours: Integer (Optional)
-     *     endTimeHours: Integer (Optional)
-     *     duration: Integer (Optional)
-     *     units: String (Required)
-     *     additionalParams (Optional): {
-     *         iconResolution: String (Optional)
-     *         details: Boolean (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     weatherMetadata (Required): {
-     *         extensionVersion: String (Required)
-     *         weatherDataType: String (Required)
-     *         extensionId: String (Required)
-     *         extensionApiName: String (Required)
-     *         language: String (Optional)
-     *         startTimeHours: Integer (Optional)
-     *         endTimeHours: Integer (Optional)
-     *         duration: Integer (Optional)
-     *         units: String (Required)
-     *         additionalParams (Optional): {
-     *             iconResolution: String (Optional)
-     *             details: Boolean (Optional)
-     *         }
-     *     }
-     *     status: String(Succeeded/Failed/PartiallySucceeded) (Optional)
-     *     locations (Optional): [
-     *          (Optional){
-     *             location (Optional): {
-     *                 type: String(LatLong/IataCode/IcaoCode/PlaceId/PostalKey) (Required)
-     *                 value: String (Required)
-     *             }
-     *             requestCompletionTime: String (Optional)
-     *             lastRefreshedDateTime: OffsetDateTime (Optional)
-     *             data (Optional): {
-     *                 wetBulbTemperature (Optional): {
-     *                     unit: String (Optional)
-     *                     values (Optional): [
-     *                         double (Optional)
-     *                     ]
-     *                 }
-     *                 cloudCover (Optional): (recursive schema, see cloudCover above)
-     *                 dayOfWeek (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 dayOrNight (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 expirationTime (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 iconCode (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 iconCodeExtend (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 hasPrecipitation (Optional): [
-     *                     boolean (Optional)
-     *                 ]
-     *                 pressureMeanSeaLevel (Optional): (recursive schema, see pressureMeanSeaLevel above)
-     *                 relativeHumidity (Optional): (recursive schema, see relativeHumidity above)
-     *                 temperature (Optional): (recursive schema, see temperature above)
-     *                 temperatureDewPoint (Optional): (recursive schema, see temperatureDewPoint above)
-     *                 temperatureFeelsLike (Optional): (recursive schema, see temperatureFeelsLike above)
-     *                 temperatureHeatIndex (Optional): (recursive schema, see temperatureHeatIndex above)
-     *                 temperatureWindChill (Optional): (recursive schema, see temperatureWindChill above)
-     *                 uvDescription (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 uvIndex (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 validTimeLocal (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 validTime (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 visibility (Optional): (recursive schema, see visibility above)
-     *                 windDirection (Optional): (recursive schema, see windDirection above)
-     *                 windGust (Optional): (recursive schema, see windGust above)
-     *                 windSpeed (Optional): (recursive schema, see windSpeed above)
-     *                 wxPhraseLong (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 wxPhraseShort (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 additionalAttributes (Optional): {
-     *                     String: Object (Optional)
-     *                 }
-     *             }
-     *         }
-     *     ]
-     *     errors (Optional): {
-     *         locations (Optional): [
-     *              (Optional){
-     *                 location (Optional): (recursive schema, see location above)
-     *                 code: Integer (Optional)
-     *                 description: String (Optional)
-     *                 retryable: Boolean (Optional)
-     *             }
-     *         ]
-     *     }
-     * }
-     * }
- * - * @param weatherDataProviderRequest Weather data provider request. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of Weather Data Provider Response along with {@link Response} on successful completion of {@link - * Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(BinaryData weatherDataProviderRequest, - RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(weatherDataProviderRequest, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/WeatherDataClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/WeatherDataClient.java deleted file mode 100644 index 705182d89711..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/WeatherDataClient.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = WeatherDataClientBuilder.class) -public final class WeatherDataClient { - @Generated - private final WeatherDataAsyncClient client; - - /** - * Initializes an instance of WeatherDataClient class. - * - * @param client the async client. - */ - @Generated - WeatherDataClient(WeatherDataAsyncClient client) { - this.client = client; - } - - /** - * Returns a list of WeatherData. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     locations (Optional): [
-     *          (Optional){
-     *             type: String(LatLong/IataCode/IcaoCode/PlaceId/PostalKey) (Required)
-     *             value: String (Required)
-     *         }
-     *     ]
-     *     providerAppId: String (Optional)
-     *     providerApiKey: String (Required)
-     *     extensionId: String (Required)
-     *     extensionApiName: String (Required)
-     *     language: String (Optional)
-     *     startTimeHours: Integer (Optional)
-     *     endTimeHours: Integer (Optional)
-     *     duration: Integer (Optional)
-     *     units: String (Required)
-     *     additionalParams (Optional): {
-     *         iconResolution: String (Optional)
-     *         details: Boolean (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     weatherMetadata (Required): {
-     *         extensionVersion: String (Required)
-     *         weatherDataType: String (Required)
-     *         extensionId: String (Required)
-     *         extensionApiName: String (Required)
-     *         language: String (Optional)
-     *         startTimeHours: Integer (Optional)
-     *         endTimeHours: Integer (Optional)
-     *         duration: Integer (Optional)
-     *         units: String (Required)
-     *         additionalParams (Optional): {
-     *             iconResolution: String (Optional)
-     *             details: Boolean (Optional)
-     *         }
-     *     }
-     *     status: String(Succeeded/Failed/PartiallySucceeded) (Optional)
-     *     locations (Optional): [
-     *          (Optional){
-     *             location (Optional): {
-     *                 type: String(LatLong/IataCode/IcaoCode/PlaceId/PostalKey) (Required)
-     *                 value: String (Required)
-     *             }
-     *             requestCompletionTime: String (Optional)
-     *             lastRefreshedDateTime: OffsetDateTime (Optional)
-     *             data (Optional): {
-     *                 wetBulbTemperature (Optional): {
-     *                     unit: String (Optional)
-     *                     values (Optional): [
-     *                         double (Optional)
-     *                     ]
-     *                 }
-     *                 cloudCover (Optional): (recursive schema, see cloudCover above)
-     *                 dayOfWeek (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 dayOrNight (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 expirationTime (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 iconCode (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 iconCodeExtend (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 hasPrecipitation (Optional): [
-     *                     boolean (Optional)
-     *                 ]
-     *                 pressureMeanSeaLevel (Optional): (recursive schema, see pressureMeanSeaLevel above)
-     *                 relativeHumidity (Optional): (recursive schema, see relativeHumidity above)
-     *                 temperature (Optional): (recursive schema, see temperature above)
-     *                 temperatureDewPoint (Optional): (recursive schema, see temperatureDewPoint above)
-     *                 temperatureFeelsLike (Optional): (recursive schema, see temperatureFeelsLike above)
-     *                 temperatureHeatIndex (Optional): (recursive schema, see temperatureHeatIndex above)
-     *                 temperatureWindChill (Optional): (recursive schema, see temperatureWindChill above)
-     *                 uvDescription (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 uvIndex (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 validTimeLocal (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 validTime (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 visibility (Optional): (recursive schema, see visibility above)
-     *                 windDirection (Optional): (recursive schema, see windDirection above)
-     *                 windGust (Optional): (recursive schema, see windGust above)
-     *                 windSpeed (Optional): (recursive schema, see windSpeed above)
-     *                 wxPhraseLong (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 wxPhraseShort (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 additionalAttributes (Optional): {
-     *                     String: Object (Optional)
-     *                 }
-     *             }
-     *         }
-     *     ]
-     *     errors (Optional): {
-     *         locations (Optional): [
-     *              (Optional){
-     *                 location (Optional): (recursive schema, see location above)
-     *                 code: Integer (Optional)
-     *                 description: String (Optional)
-     *                 retryable: Boolean (Optional)
-     *             }
-     *         ]
-     *     }
-     * }
-     * }
- * - * @param weatherDataProviderRequest Weather data provider request. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of Weather Data Provider Response along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(BinaryData weatherDataProviderRequest, RequestOptions requestOptions) { - return this.client.getWithResponse(weatherDataProviderRequest, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/WeatherDataClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/WeatherDataClientBuilder.java deleted file mode 100644 index 8cfbf37a6e0a..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/WeatherDataClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the WeatherDataClient type. */ -@ServiceClientBuilder(serviceClients = { WeatherDataClient.class, WeatherDataAsyncClient.class }) -public final class WeatherDataClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the WeatherDataClientBuilder. */ - @Generated - public WeatherDataClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public WeatherDataClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public WeatherDataClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public WeatherDataClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public WeatherDataClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public WeatherDataClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public WeatherDataClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public WeatherDataClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public WeatherDataClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public WeatherDataClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the WeatherDataClientBuilder. - */ - @Generated - public WeatherDataClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the WeatherDataClientBuilder. - */ - @Generated - public WeatherDataClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of WeatherDataAsyncClient class. - * - * @return an instance of WeatherDataAsyncClient. - */ - @Generated - public WeatherDataAsyncClient buildAsyncClient() { - return new WeatherDataAsyncClient(buildInnerClient().getWeatherDatas()); - } - - /** - * Builds an instance of WeatherDataClient class. - * - * @return an instance of WeatherDataClient. - */ - @Generated - public WeatherDataClient buildClient() { - return new WeatherDataClient(new WeatherDataAsyncClient(buildInnerClient().getWeatherDatas())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ZonesAsyncClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ZonesAsyncClient.java deleted file mode 100644 index 2c331f9c1880..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ZonesAsyncClient.java +++ /dev/null @@ -1,370 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollerFlux; -import com.azure.verticals.agrifood.farming.implementation.ZonesImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous FarmBeatsClient type. */ -@ServiceClient(builder = ZonesClientBuilder.class, isAsync = true) -public final class ZonesAsyncClient { - @Generated - private final ZonesImpl serviceClient; - - /** - * Initializes an instance of ZonesAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - ZonesAsyncClient(ZonesImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Returns a paginated list of zone resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
managementZoneIdsList<String>NoManagementZoneIds of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     managementZoneId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyId(String partyId, RequestOptions requestOptions) { - return this.serviceClient.listByPartyIdAsync(partyId, requestOptions); - } - - /** - * Gets a specified zone resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     managementZoneId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param zoneId Id of the zone. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified zone resource under a particular party along with {@link Response} on successful completion - * of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse(String partyId, String zoneId, RequestOptions requestOptions) { - return this.serviceClient.getWithResponseAsync(partyId, zoneId, requestOptions); - } - - /** - * Creates or updates a Zone resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     managementZoneId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     managementZoneId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party resource. - * @param zoneId Id of the zone resource. - * @param zone Zone resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return api Model for Zone object along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponse(String partyId, String zoneId, BinaryData zone, - RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateWithResponseAsync(partyId, zoneId, zone, requestOptions); - } - - /** - * Deletes a specified zone resource under a particular party. - * - * @param partyId Id of the party. - * @param zoneId Id of the zone. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse(String partyId, String zoneId, RequestOptions requestOptions) { - return this.serviceClient.deleteWithResponseAsync(partyId, zoneId, requestOptions); - } - - /** - * Returns a paginated list of zone resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
managementZoneIdsList<String>NoManagementZoneIds of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     managementZoneId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(RequestOptions requestOptions) { - return this.serviceClient.listAsync(requestOptions); - } - - /** - * Get a cascade delete job for specified job id. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified job id along with {@link Response} on successful completion of {@link - * Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponse(String jobId, - RequestOptions requestOptions) { - return this.serviceClient.getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions); - } - - /** - * Create a cascade delete job for specified zone. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param zoneId ID of the zone to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJob(String jobId, String partyId, String zoneId, - RequestOptions requestOptions) { - return this.serviceClient.beginCreateCascadeDeleteJobAsync(jobId, partyId, zoneId, requestOptions); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ZonesClient.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ZonesClient.java deleted file mode 100644 index 7069e0fd203b..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ZonesClient.java +++ /dev/null @@ -1,365 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.SyncPoller; - -/** Initializes a new instance of the synchronous FarmBeatsClient type. */ -@ServiceClient(builder = ZonesClientBuilder.class) -public final class ZonesClient { - @Generated - private final ZonesAsyncClient client; - - /** - * Initializes an instance of ZonesClient class. - * - * @param client the async client. - */ - @Generated - ZonesClient(ZonesAsyncClient client) { - this.client = client; - } - - /** - * Returns a paginated list of zone resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
managementZoneIdsList<String>NoManagementZoneIds of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     managementZoneId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listByPartyId(partyId, requestOptions)); - } - - /** - * Gets a specified zone resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     managementZoneId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param zoneId Id of the zone. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified zone resource under a particular party along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String zoneId, RequestOptions requestOptions) { - return this.client.getWithResponse(partyId, zoneId, requestOptions).block(); - } - - /** - * Creates or updates a Zone resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     managementZoneId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     managementZoneId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party resource. - * @param zoneId Id of the zone resource. - * @param zone Zone resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return api Model for Zone object along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String zoneId, BinaryData zone, - RequestOptions requestOptions) { - return this.client.createOrUpdateWithResponse(partyId, zoneId, zone, requestOptions).block(); - } - - /** - * Deletes a specified zone resource under a particular party. - * - * @param partyId Id of the party. - * @param zoneId Id of the zone. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String zoneId, RequestOptions requestOptions) { - return this.client.deleteWithResponse(partyId, zoneId, requestOptions).block(); - } - - /** - * Returns a paginated list of zone resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
managementZoneIdsList<String>NoManagementZoneIds of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     managementZoneId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.list(requestOptions)); - } - - /** - * Get a cascade delete job for specified job id. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified job id along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return this.client.getCascadeDeleteJobDetailsWithResponse(jobId, requestOptions).block(); - } - - /** - * Create a cascade delete job for specified zone. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param zoneId ID of the zone to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, String zoneId, - RequestOptions requestOptions) { - return this.client.beginCreateCascadeDeleteJob(jobId, partyId, zoneId, requestOptions).getSyncPoller(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ZonesClientBuilder.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ZonesClientBuilder.java deleted file mode 100644 index 33b132f396eb..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/ZonesClientBuilder.java +++ /dev/null @@ -1,301 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.verticals.agrifood.farming.implementation.FarmBeatsClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the ZonesClient type. */ -@ServiceClientBuilder(serviceClients = { ZonesClient.class, ZonesAsyncClient.class }) -public final class ZonesClientBuilder implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://farmbeats.azure.net/.default" }; - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-verticals-agrifood-farming.properties"); - - @Generated - private final List pipelinePolicies; - - /** Create an instance of the ZonesClientBuilder. */ - @Generated - public ZonesClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public ZonesClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public ZonesClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public ZonesClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public ZonesClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public ZonesClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public ZonesClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public ZonesClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public ZonesClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public ZonesClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private FarmBeatsServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the ZonesClientBuilder. - */ - @Generated - public ZonesClientBuilder serviceVersion(FarmBeatsServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the ZonesClientBuilder. - */ - @Generated - public ZonesClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of FarmBeatsClientImpl with the provided parameters. - * - * @return an instance of FarmBeatsClientImpl. - */ - @Generated - private FarmBeatsClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FarmBeatsServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FarmBeatsServiceVersion.getLatest(); - FarmBeatsClientImpl client = new FarmBeatsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll(this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of ZonesAsyncClient class. - * - * @return an instance of ZonesAsyncClient. - */ - @Generated - public ZonesAsyncClient buildAsyncClient() { - return new ZonesAsyncClient(buildInnerClient().getZones()); - } - - /** - * Builds an instance of ZonesClient class. - * - * @return an instance of ZonesClient. - */ - @Generated - public ZonesClient buildClient() { - return new ZonesClient(new ZonesAsyncClient(buildInnerClient().getZones())); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/ApplicationDatasImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/ApplicationDatasImpl.java deleted file mode 100644 index 47de57fd9856..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/ApplicationDatasImpl.java +++ /dev/null @@ -1,1432 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.DefaultPollingStrategy; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.core.util.serializer.TypeReference; -import java.time.Duration; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ApplicationDatas. */ -public final class ApplicationDatasImpl { - /** The proxy service used to perform REST calls. */ - private final ApplicationDatasService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of ApplicationDatasImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ApplicationDatasImpl(FarmBeatsClientImpl client) { - this.service - = RestProxy.create(ApplicationDatasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientApplicationDatas to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientAppli") - public interface ApplicationDatasService { - @Get("/application-data") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Put("/application-data/cascade-delete/{jobId}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createCascadeDeleteJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("partyId") String partyId, - @QueryParam("applicationDataId") String applicationDataId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/application-data/cascade-delete/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getCascadeDeleteJobDetails(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/application-data") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyId(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/application-data/{applicationDataId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("applicationDataId") String applicationDataId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Patch("/parties/{partyId}/application-data/{applicationDataId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @PathParam("applicationDataId") String applicationDataId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData applicationData, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/parties/{partyId}/application-data/{applicationDataId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("applicationDataId") String applicationDataId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyIdNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of application data resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minAvgMaterialDoubleNoMinimum average amount of material applied during the application (inclusive).
maxAvgMaterialDoubleNoMaximum average amount of material applied during the application (inclusive).
minTotalMaterialDoubleNoMinimum total amount of material applied during the application (inclusive).
maxTotalMaterialDoubleNoMaximum total amount of material applied during the application (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     applicationProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             isCarrier: Boolean (Optional)
-     *             avgMaterial (Optional): {
-     *                 unit: String (Optional)
-     *                 value: Double (Optional)
-     *             }
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *         }
-     *     ]
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of application data resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minAvgMaterialDoubleNoMinimum average amount of material applied during the application (inclusive).
maxAvgMaterialDoubleNoMaximum average amount of material applied during the application (inclusive).
minTotalMaterialDoubleNoMinimum total amount of material applied during the application (inclusive).
maxTotalMaterialDoubleNoMaximum total amount of material applied during the application (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     applicationProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             isCarrier: Boolean (Optional)
-     *             avgMaterial (Optional): {
-     *                 unit: String (Optional)
-     *                 value: Double (Optional)
-     *             }
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *         }
-     *     ]
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of application data resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minAvgMaterialDoubleNoMinimum average amount of material applied during the application (inclusive).
maxAvgMaterialDoubleNoMaximum average amount of material applied during the application (inclusive).
minTotalMaterialDoubleNoMinimum total amount of material applied during the application (inclusive).
maxTotalMaterialDoubleNoMaximum total amount of material applied during the application (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     applicationProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             isCarrier: Boolean (Optional)
-     *             avgMaterial (Optional): {
-     *                 unit: String (Optional)
-     *                 value: Double (Optional)
-     *             }
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *         }
-     *     ]
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(requestOptions)); - } - - /** - * Create cascade delete job for application data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param partyId Id of the party. - * @param applicationDataId Id of the application data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of cascade delete job along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createCascadeDeleteJobWithResponseAsync(String jobId, String partyId, - String applicationDataId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createCascadeDeleteJob(this.client.getEndpoint(), jobId, partyId, - applicationDataId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Create cascade delete job for application data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param partyId Id of the party. - * @param applicationDataId Id of the application data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJobAsync(String jobId, String partyId, - String applicationDataId, RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createCascadeDeleteJobWithResponseAsync(jobId, partyId, applicationDataId, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Create cascade delete job for application data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param partyId Id of the party. - * @param applicationDataId Id of the application data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, - String applicationDataId, RequestOptions requestOptions) { - return this.beginCreateCascadeDeleteJobAsync(jobId, partyId, applicationDataId, requestOptions).getSyncPoller(); - } - - /** - * Get cascade delete job for application data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for application data resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponseAsync(String jobId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getCascadeDeleteJobDetails(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get cascade delete job for application data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for application data resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions).block(); - } - - /** - * Returns a paginated list of application data resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minAvgMaterialDoubleNoMinimum average amount of material applied during the application (inclusive).
maxAvgMaterialDoubleNoMaximum average amount of material applied during the application (inclusive).
minTotalMaterialDoubleNoMinimum total amount of material applied during the application (inclusive).
maxTotalMaterialDoubleNoMaximum total amount of material applied during the application (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     applicationProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             isCarrier: Boolean (Optional)
-     *             avgMaterial (Optional): {
-     *                 unit: String (Optional)
-     *                 value: Double (Optional)
-     *             }
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *         }
-     *     ]
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdSinglePageAsync(String partyId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByPartyId(this.client.getEndpoint(), partyId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of application data resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minAvgMaterialDoubleNoMinimum average amount of material applied during the application (inclusive).
maxAvgMaterialDoubleNoMaximum average amount of material applied during the application (inclusive).
minTotalMaterialDoubleNoMinimum total amount of material applied during the application (inclusive).
maxTotalMaterialDoubleNoMaximum total amount of material applied during the application (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     applicationProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             isCarrier: Boolean (Optional)
-     *             avgMaterial (Optional): {
-     *                 unit: String (Optional)
-     *                 value: Double (Optional)
-     *             }
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *         }
-     *     ]
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyIdAsync(String partyId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listByPartyIdSinglePageAsync(partyId, requestOptions), - nextLink -> listByPartyIdNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of application data resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minAvgMaterialDoubleNoMinimum average amount of material applied during the application (inclusive).
maxAvgMaterialDoubleNoMaximum average amount of material applied during the application (inclusive).
minTotalMaterialDoubleNoMinimum total amount of material applied during the application (inclusive).
maxTotalMaterialDoubleNoMaximum total amount of material applied during the application (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     applicationProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             isCarrier: Boolean (Optional)
-     *             avgMaterial (Optional): {
-     *                 unit: String (Optional)
-     *                 value: Double (Optional)
-     *             }
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *         }
-     *     ]
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(listByPartyIdAsync(partyId, requestOptions)); - } - - /** - * Get a specified application data resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     applicationProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             isCarrier: Boolean (Optional)
-     *             avgMaterial (Optional): {
-     *                 unit: String (Optional)
-     *                 value: Double (Optional)
-     *             }
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *         }
-     *     ]
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party resource. - * @param applicationDataId ID of the application data resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified application data resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String partyId, String applicationDataId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), partyId, applicationDataId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get a specified application data resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     applicationProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             isCarrier: Boolean (Optional)
-     *             avgMaterial (Optional): {
-     *                 unit: String (Optional)
-     *                 value: Double (Optional)
-     *             }
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *         }
-     *     ]
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party resource. - * @param applicationDataId ID of the application data resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified application data resource under a particular party along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String applicationDataId, - RequestOptions requestOptions) { - return getWithResponseAsync(partyId, applicationDataId, requestOptions).block(); - } - - /** - * Creates or updates an application data resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     applicationProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             isCarrier: Boolean (Optional)
-     *             avgMaterial (Optional): {
-     *                 unit: String (Optional)
-     *                 value: Double (Optional)
-     *             }
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *         }
-     *     ]
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     applicationProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             isCarrier: Boolean (Optional)
-     *             avgMaterial (Optional): {
-     *                 unit: String (Optional)
-     *                 value: Double (Optional)
-     *             }
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *         }
-     *     ]
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param applicationDataId ID of the application data resource. - * @param applicationData Application data resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of application data resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String partyId, String applicationDataId, - BinaryData applicationData, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), partyId, applicationDataId, - this.client.getServiceVersion().getVersion(), applicationData, accept, requestOptions, context)); - } - - /** - * Creates or updates an application data resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     applicationProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             isCarrier: Boolean (Optional)
-     *             avgMaterial (Optional): {
-     *                 unit: String (Optional)
-     *                 value: Double (Optional)
-     *             }
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *         }
-     *     ]
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     applicationProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             isCarrier: Boolean (Optional)
-     *             avgMaterial (Optional): {
-     *                 unit: String (Optional)
-     *                 value: Double (Optional)
-     *             }
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *         }
-     *     ]
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param applicationDataId ID of the application data resource. - * @param applicationData Application data resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of application data resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String applicationDataId, - BinaryData applicationData, RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(partyId, applicationDataId, applicationData, requestOptions).block(); - } - - /** - * Deletes a specified application data resource under a particular party. - * - * @param partyId ID of the associated party resource. - * @param applicationDataId ID of the application data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String partyId, String applicationDataId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), partyId, applicationDataId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a specified application data resource under a particular party. - * - * @param partyId ID of the associated party resource. - * @param applicationDataId ID of the application data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String applicationDataId, RequestOptions requestOptions) { - return deleteWithResponseAsync(partyId, applicationDataId, requestOptions).block(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     applicationProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             isCarrier: Boolean (Optional)
-     *             avgMaterial (Optional): {
-     *                 unit: String (Optional)
-     *                 value: Double (Optional)
-     *             }
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *         }
-     *     ]
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     applicationProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             isCarrier: Boolean (Optional)
-     *             avgMaterial (Optional): {
-     *                 unit: String (Optional)
-     *                 value: Double (Optional)
-     *             }
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *         }
-     *     ]
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listByPartyIdNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/AttachmentsImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/AttachmentsImpl.java deleted file mode 100644 index 69c219974769..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/AttachmentsImpl.java +++ /dev/null @@ -1,666 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in Attachments. */ -public final class AttachmentsImpl { - /** The proxy service used to perform REST calls. */ - private final AttachmentsService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of AttachmentsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AttachmentsImpl(FarmBeatsClientImpl client) { - this.service - = RestProxy.create(AttachmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientAttachments to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientAttac") - public interface AttachmentsService { - @Get("/parties/{partyId}/attachments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyId(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/attachments/{attachmentId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("attachmentId") String attachmentId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - // @Multipart not supported by RestProxy - @Patch("/parties/{partyId}/attachments/{attachmentId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @PathParam("attachmentId") String attachmentId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/parties/{partyId}/attachments/{attachmentId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("attachmentId") String attachmentId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/attachments/{attachmentId}/file") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> download(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @PathParam("attachmentId") String attachmentId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyIdNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of attachment resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
resourceIdsList<String>NoResource Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
resourceTypesList<String>NoResource Types of the resource. - * i.e. Party, Farm, Field, SeasonalField, Boundary, ApplicationData, HarvestData, TillageData, PlantingData, PlantTissueAnalysis. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary/ApplicationData/HarvestData/TillageData/PlantingData/PlantTissueAnalysis) (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdSinglePageAsync(String partyId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByPartyId(this.client.getEndpoint(), partyId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of attachment resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
resourceIdsList<String>NoResource Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
resourceTypesList<String>NoResource Types of the resource. - * i.e. Party, Farm, Field, SeasonalField, Boundary, ApplicationData, HarvestData, TillageData, PlantingData, PlantTissueAnalysis. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary/ApplicationData/HarvestData/TillageData/PlantingData/PlantTissueAnalysis) (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyIdAsync(String partyId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listByPartyIdSinglePageAsync(partyId, requestOptions), - nextLink -> listByPartyIdNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of attachment resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
resourceIdsList<String>NoResource Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
resourceTypesList<String>NoResource Types of the resource. - * i.e. Party, Farm, Field, SeasonalField, Boundary, ApplicationData, HarvestData, TillageData, PlantingData, PlantTissueAnalysis. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary/ApplicationData/HarvestData/TillageData/PlantingData/PlantTissueAnalysis) (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(listByPartyIdAsync(partyId, requestOptions)); - } - - /** - * Gets a specified attachment resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary/ApplicationData/HarvestData/TillageData/PlantingData/PlantTissueAnalysis) (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param attachmentId Id of the attachment. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified attachment resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String partyId, String attachmentId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), partyId, attachmentId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Gets a specified attachment resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary/ApplicationData/HarvestData/TillageData/PlantingData/PlantTissueAnalysis) (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param attachmentId Id of the attachment. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified attachment resource under a particular party along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String attachmentId, RequestOptions requestOptions) { - return getWithResponseAsync(partyId, attachmentId, requestOptions).block(); - } - - /** - * Creates or updates an attachment resource under a particular party. - * - *

Header Parameters - * - * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: "multipart/form-data".
- * - * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Request Body Schema - * - *

{@code
-     * BinaryData
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary/ApplicationData/HarvestData/TillageData/PlantingData/PlantTissueAnalysis) (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party resource. - * @param attachmentId Id of the attachment resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of attachment resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String partyId, String attachmentId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), partyId, attachmentId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Creates or updates an attachment resource under a particular party. - * - *

Header Parameters - * - * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: "multipart/form-data".
- * - * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Request Body Schema - * - *

{@code
-     * BinaryData
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary/ApplicationData/HarvestData/TillageData/PlantingData/PlantTissueAnalysis) (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party resource. - * @param attachmentId Id of the attachment resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of attachment resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String attachmentId, - RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(partyId, attachmentId, requestOptions).block(); - } - - /** - * Deletes a specified attachment resource under a particular party. - * - * @param partyId Id of the party. - * @param attachmentId Id of the attachment. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String partyId, String attachmentId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), partyId, attachmentId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a specified attachment resource under a particular party. - * - * @param partyId Id of the party. - * @param attachmentId Id of the attachment. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String attachmentId, RequestOptions requestOptions) { - return deleteWithResponseAsync(partyId, attachmentId, requestOptions).block(); - } - - /** - * Downloads and returns attachment as response for the given input filePath. - * - *

Response Body Schema - * - *

{@code
-     * BinaryData
-     * }
- * - * @param partyId Id of the associated party. - * @param attachmentId Id of attachment to be downloaded. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> downloadWithResponseAsync(String partyId, String attachmentId, - RequestOptions requestOptions) { - final String accept = "application/json, application/octet-stream"; - return FluxUtil.withContext(context -> service.download(this.client.getEndpoint(), partyId, attachmentId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Downloads and returns attachment as response for the given input filePath. - * - *

Response Body Schema - * - *

{@code
-     * BinaryData
-     * }
- * - * @param partyId Id of the associated party. - * @param attachmentId Id of attachment to be downloaded. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response downloadWithResponse(String partyId, String attachmentId, - RequestOptions requestOptions) { - return downloadWithResponseAsync(partyId, attachmentId, requestOptions).block(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary/ApplicationData/HarvestData/TillageData/PlantingData/PlantTissueAnalysis) (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listByPartyIdNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/BoundariesImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/BoundariesImpl.java deleted file mode 100644 index b1ca43bfb854..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/BoundariesImpl.java +++ /dev/null @@ -1,1957 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.DefaultPollingStrategy; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.core.util.serializer.TypeReference; -import java.time.Duration; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in Boundaries. */ -public final class BoundariesImpl { - /** The proxy service used to perform REST calls. */ - private final BoundariesService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of BoundariesImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BoundariesImpl(FarmBeatsClientImpl client) { - this.service - = RestProxy.create(BoundariesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientBoundaries to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientBound") - public interface BoundariesService { - @Get("/boundaries") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Post("/boundaries") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> search(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") BinaryData searchBoundaryQuery, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Put("/boundaries/cascade-delete/{jobId}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createCascadeDeleteJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("partyId") String partyId, - @QueryParam("boundaryId") String boundaryId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/boundaries/cascade-delete/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getCascadeDeleteJobDetails(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/boundaries") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyId(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Post("/parties/{partyId}/boundaries") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> searchByPartyId(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BinaryData searchBoundaryQuery, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Patch("/parties/{partyId}/boundaries/{boundaryId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @PathParam("boundaryId") String boundaryId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData boundary, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/boundaries/{boundaryId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("boundaryId") String boundaryId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Delete("/parties/{partyId}/boundaries/{boundaryId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("boundaryId") String boundaryId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/boundaries/{boundaryId}/overlap") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getOverlap(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @PathParam("boundaryId") String boundaryId, - @QueryParam("otherPartyId") String otherPartyId, @QueryParam("otherBoundaryId") String otherBoundaryId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> searchNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyIdNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> searchByPartyIdNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of boundary resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
parentTypeStringNoType of the parent it belongs to.
typeStringNoType it belongs to.
parentIdsList<String>NoParent Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minAreaDoubleNoMinimum area of the boundary (inclusive).
maxAreaDoubleNoMaximum acreage of the boundary (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of boundary resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
parentTypeStringNoType of the parent it belongs to.
typeStringNoType it belongs to.
parentIdsList<String>NoParent Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minAreaDoubleNoMinimum area of the boundary (inclusive).
maxAreaDoubleNoMaximum acreage of the boundary (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of boundary resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
parentTypeStringNoType of the parent it belongs to.
typeStringNoType it belongs to.
parentIdsList<String>NoParent Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minAreaDoubleNoMinimum area of the boundary (inclusive).
maxAreaDoubleNoMaximum acreage of the boundary (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(requestOptions)); - } - - /** - * Search for boundaries across all parties by fields and intersecting geometry. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     ids (Optional): [
-     *         String (Optional)
-     *     ]
-     *     names (Optional): [
-     *         String (Optional)
-     *     ]
-     *     propertyFilters (Optional): [
-     *         String (Optional)
-     *     ]
-     *     statuses (Optional): [
-     *         String (Optional)
-     *     ]
-     *     minCreatedDateTime: OffsetDateTime (Optional)
-     *     maxCreatedDateTime: OffsetDateTime (Optional)
-     *     minLastModifiedDateTime: OffsetDateTime (Optional)
-     *     maxLastModifiedDateTime: OffsetDateTime (Optional)
-     *     maxPageSize: Integer (Optional)
-     *     skipToken: String (Optional)
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     parentIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     minArea: Double (Optional)
-     *     maxArea: Double (Optional)
-     *     intersectsWithGeometry (Optional): {
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param searchBoundaryQuery Query filters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> searchSinglePageAsync(BinaryData searchBoundaryQuery, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.search(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), searchBoundaryQuery, accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Search for boundaries across all parties by fields and intersecting geometry. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     ids (Optional): [
-     *         String (Optional)
-     *     ]
-     *     names (Optional): [
-     *         String (Optional)
-     *     ]
-     *     propertyFilters (Optional): [
-     *         String (Optional)
-     *     ]
-     *     statuses (Optional): [
-     *         String (Optional)
-     *     ]
-     *     minCreatedDateTime: OffsetDateTime (Optional)
-     *     maxCreatedDateTime: OffsetDateTime (Optional)
-     *     minLastModifiedDateTime: OffsetDateTime (Optional)
-     *     maxLastModifiedDateTime: OffsetDateTime (Optional)
-     *     maxPageSize: Integer (Optional)
-     *     skipToken: String (Optional)
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     parentIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     minArea: Double (Optional)
-     *     maxArea: Double (Optional)
-     *     intersectsWithGeometry (Optional): {
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param searchBoundaryQuery Query filters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux searchAsync(BinaryData searchBoundaryQuery, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> searchSinglePageAsync(searchBoundaryQuery, requestOptions), - nextLink -> searchNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Search for boundaries across all parties by fields and intersecting geometry. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     ids (Optional): [
-     *         String (Optional)
-     *     ]
-     *     names (Optional): [
-     *         String (Optional)
-     *     ]
-     *     propertyFilters (Optional): [
-     *         String (Optional)
-     *     ]
-     *     statuses (Optional): [
-     *         String (Optional)
-     *     ]
-     *     minCreatedDateTime: OffsetDateTime (Optional)
-     *     maxCreatedDateTime: OffsetDateTime (Optional)
-     *     minLastModifiedDateTime: OffsetDateTime (Optional)
-     *     maxLastModifiedDateTime: OffsetDateTime (Optional)
-     *     maxPageSize: Integer (Optional)
-     *     skipToken: String (Optional)
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     parentIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     minArea: Double (Optional)
-     *     maxArea: Double (Optional)
-     *     intersectsWithGeometry (Optional): {
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param searchBoundaryQuery Query filters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable search(BinaryData searchBoundaryQuery, RequestOptions requestOptions) { - return new PagedIterable<>(searchAsync(searchBoundaryQuery, requestOptions)); - } - - /** - * Create a cascade delete job for specified boundary. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param boundaryId ID of the boundary to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of cascade delete job along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createCascadeDeleteJobWithResponseAsync(String jobId, String partyId, - String boundaryId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createCascadeDeleteJob(this.client.getEndpoint(), jobId, partyId, - boundaryId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Create a cascade delete job for specified boundary. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param boundaryId ID of the boundary to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJobAsync(String jobId, String partyId, - String boundaryId, RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createCascadeDeleteJobWithResponseAsync(jobId, partyId, boundaryId, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Create a cascade delete job for specified boundary. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param boundaryId ID of the boundary to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, - String boundaryId, RequestOptions requestOptions) { - return this.beginCreateCascadeDeleteJobAsync(jobId, partyId, boundaryId, requestOptions).getSyncPoller(); - } - - /** - * Get cascade delete job for specified boundary. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for specified boundary along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponseAsync(String jobId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getCascadeDeleteJobDetails(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get cascade delete job for specified boundary. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for specified boundary along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions).block(); - } - - /** - * Returns a paginated list of boundary resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
parentTypeStringNoType of the parent it belongs to.
typeStringNoType it belongs to.
parentIdsList<String>NoParent Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minAreaDoubleNoMinimum area of the boundary (inclusive).
maxAreaDoubleNoMaximum acreage of the boundary (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdSinglePageAsync(String partyId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByPartyId(this.client.getEndpoint(), partyId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of boundary resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
parentTypeStringNoType of the parent it belongs to.
typeStringNoType it belongs to.
parentIdsList<String>NoParent Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minAreaDoubleNoMinimum area of the boundary (inclusive).
maxAreaDoubleNoMaximum acreage of the boundary (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyIdAsync(String partyId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listByPartyIdSinglePageAsync(partyId, requestOptions), - nextLink -> listByPartyIdNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of boundary resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
parentTypeStringNoType of the parent it belongs to.
typeStringNoType it belongs to.
parentIdsList<String>NoParent Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minAreaDoubleNoMinimum area of the boundary (inclusive).
maxAreaDoubleNoMaximum acreage of the boundary (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(listByPartyIdAsync(partyId, requestOptions)); - } - - /** - * Search for boundaries by fields and intersecting geometry. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     ids (Optional): [
-     *         String (Optional)
-     *     ]
-     *     names (Optional): [
-     *         String (Optional)
-     *     ]
-     *     propertyFilters (Optional): [
-     *         String (Optional)
-     *     ]
-     *     statuses (Optional): [
-     *         String (Optional)
-     *     ]
-     *     minCreatedDateTime: OffsetDateTime (Optional)
-     *     maxCreatedDateTime: OffsetDateTime (Optional)
-     *     minLastModifiedDateTime: OffsetDateTime (Optional)
-     *     maxLastModifiedDateTime: OffsetDateTime (Optional)
-     *     maxPageSize: Integer (Optional)
-     *     skipToken: String (Optional)
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     parentIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     minArea: Double (Optional)
-     *     maxArea: Double (Optional)
-     *     intersectsWithGeometry (Optional): {
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party. - * @param searchBoundaryQuery Query filters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> searchByPartyIdSinglePageAsync(String partyId, - BinaryData searchBoundaryQuery, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.searchByPartyId(this.client.getEndpoint(), partyId, - this.client.getServiceVersion().getVersion(), searchBoundaryQuery, accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Search for boundaries by fields and intersecting geometry. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     ids (Optional): [
-     *         String (Optional)
-     *     ]
-     *     names (Optional): [
-     *         String (Optional)
-     *     ]
-     *     propertyFilters (Optional): [
-     *         String (Optional)
-     *     ]
-     *     statuses (Optional): [
-     *         String (Optional)
-     *     ]
-     *     minCreatedDateTime: OffsetDateTime (Optional)
-     *     maxCreatedDateTime: OffsetDateTime (Optional)
-     *     minLastModifiedDateTime: OffsetDateTime (Optional)
-     *     maxLastModifiedDateTime: OffsetDateTime (Optional)
-     *     maxPageSize: Integer (Optional)
-     *     skipToken: String (Optional)
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     parentIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     minArea: Double (Optional)
-     *     maxArea: Double (Optional)
-     *     intersectsWithGeometry (Optional): {
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party. - * @param searchBoundaryQuery Query filters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux searchByPartyIdAsync(String partyId, BinaryData searchBoundaryQuery, - RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> searchByPartyIdSinglePageAsync(partyId, searchBoundaryQuery, requestOptions), - nextLink -> searchByPartyIdNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Search for boundaries by fields and intersecting geometry. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     ids (Optional): [
-     *         String (Optional)
-     *     ]
-     *     names (Optional): [
-     *         String (Optional)
-     *     ]
-     *     propertyFilters (Optional): [
-     *         String (Optional)
-     *     ]
-     *     statuses (Optional): [
-     *         String (Optional)
-     *     ]
-     *     minCreatedDateTime: OffsetDateTime (Optional)
-     *     maxCreatedDateTime: OffsetDateTime (Optional)
-     *     minLastModifiedDateTime: OffsetDateTime (Optional)
-     *     maxLastModifiedDateTime: OffsetDateTime (Optional)
-     *     maxPageSize: Integer (Optional)
-     *     skipToken: String (Optional)
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     parentIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     minArea: Double (Optional)
-     *     maxArea: Double (Optional)
-     *     intersectsWithGeometry (Optional): {
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party. - * @param searchBoundaryQuery Query filters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable searchByPartyId(String partyId, BinaryData searchBoundaryQuery, - RequestOptions requestOptions) { - return new PagedIterable<>(searchByPartyIdAsync(partyId, searchBoundaryQuery, requestOptions)); - } - - /** - * Creates or updates a boundary resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     geometry (Optional): {
-     *     }
-     *     type: String (Optional)
-     *     crs: String (Optional)
-     *     centroid (Optional): (recursive schema, see centroid above)
-     *     bbox (Optional): (recursive schema, see bbox above)
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     geometry (Optional): {
-     *     }
-     *     type: String (Optional)
-     *     crs: String (Optional)
-     *     centroid (Optional): (recursive schema, see centroid above)
-     *     bbox (Optional): (recursive schema, see bbox above)
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party resource. - * @param boundaryId Id of the boundary resource. - * @param boundary Boundary resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of boundary resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String partyId, String boundaryId, - BinaryData boundary, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), partyId, boundaryId, - this.client.getServiceVersion().getVersion(), boundary, accept, requestOptions, context)); - } - - /** - * Creates or updates a boundary resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     geometry (Optional): {
-     *     }
-     *     type: String (Optional)
-     *     crs: String (Optional)
-     *     centroid (Optional): (recursive schema, see centroid above)
-     *     bbox (Optional): (recursive schema, see bbox above)
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     geometry (Optional): {
-     *     }
-     *     type: String (Optional)
-     *     crs: String (Optional)
-     *     centroid (Optional): (recursive schema, see centroid above)
-     *     bbox (Optional): (recursive schema, see bbox above)
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party resource. - * @param boundaryId Id of the boundary resource. - * @param boundary Boundary resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of boundary resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String boundaryId, BinaryData boundary, - RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(partyId, boundaryId, boundary, requestOptions).block(); - } - - /** - * Gets a specified boundary resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     geometry (Optional): {
-     *     }
-     *     type: String (Optional)
-     *     crs: String (Optional)
-     *     centroid (Optional): (recursive schema, see centroid above)
-     *     bbox (Optional): (recursive schema, see bbox above)
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param boundaryId Id of the boundary. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified boundary resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String partyId, String boundaryId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), partyId, boundaryId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Gets a specified boundary resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     geometry (Optional): {
-     *     }
-     *     type: String (Optional)
-     *     crs: String (Optional)
-     *     centroid (Optional): (recursive schema, see centroid above)
-     *     bbox (Optional): (recursive schema, see bbox above)
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param boundaryId Id of the boundary. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified boundary resource under a particular party along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String boundaryId, RequestOptions requestOptions) { - return getWithResponseAsync(partyId, boundaryId, requestOptions).block(); - } - - /** - * Deletes a specified boundary resource under a particular party. - * - * @param partyId Id of the party. - * @param boundaryId Id of the boundary. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String partyId, String boundaryId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), partyId, boundaryId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a specified boundary resource under a particular party. - * - * @param partyId Id of the party. - * @param boundaryId Id of the boundary. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String boundaryId, RequestOptions requestOptions) { - return deleteWithResponseAsync(partyId, boundaryId, requestOptions).block(); - } - - /** - * Returns overlapping area between two boundary Ids. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     boundaryArea: Double (Optional)
-     *     otherBoundaryArea: Double (Optional)
-     *     intersectingArea: Double (Optional)
-     * }
-     * }
- * - * @param partyId Id of the party. - * @param boundaryId Id of the boundary. - * @param otherPartyId PartyId of the other field. - * @param otherBoundaryId Id of the other boundary. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of boundary overlap response along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getOverlapWithResponseAsync(String partyId, String boundaryId, - String otherPartyId, String otherBoundaryId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getOverlap(this.client.getEndpoint(), partyId, boundaryId, otherPartyId, - otherBoundaryId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Returns overlapping area between two boundary Ids. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     boundaryArea: Double (Optional)
-     *     otherBoundaryArea: Double (Optional)
-     *     intersectingArea: Double (Optional)
-     * }
-     * }
- * - * @param partyId Id of the party. - * @param boundaryId Id of the boundary. - * @param otherPartyId PartyId of the other field. - * @param otherBoundaryId Id of the other boundary. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of boundary overlap response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getOverlapWithResponse(String partyId, String boundaryId, String otherPartyId, - String otherBoundaryId, RequestOptions requestOptions) { - return getOverlapWithResponseAsync(partyId, boundaryId, otherPartyId, otherBoundaryId, requestOptions).block(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> searchNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.searchNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listByPartyIdNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     area (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     parentType: String(Field/SeasonalField/Zone/Prescription/PlantTissueAnalysis/ApplicationData/PlantingData/TillageData/HarvestData) (Optional)
-     *     type: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> searchByPartyIdNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.searchByPartyIdNext(nextLink, this.client.getEndpoint(), accept, - requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/CropProductsImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/CropProductsImpl.java deleted file mode 100644 index 61fe19702a28..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/CropProductsImpl.java +++ /dev/null @@ -1,727 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in CropProducts. */ -public final class CropProductsImpl { - /** The proxy service used to perform REST calls. */ - private final CropProductsService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of CropProductsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CropProductsImpl(FarmBeatsClientImpl client) { - this.service - = RestProxy.create(CropProductsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientCropProducts to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientCropP") - public interface CropProductsService { - @Get("/crop-products") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/crop-products/{cropProductId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @PathParam("cropProductId") String cropProductId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Patch("/crop-products/{cropProductId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("cropProductId") String cropProductId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData cropProduct, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/crop-products/{cropProductId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @PathParam("cropProductId") String cropProductId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of crop product resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
cropIdsList<String>NoCropIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
brandsList<String>NoBrands of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
productsList<String>NoProducts of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
traitsList<String>NoTraits of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     cropIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     brand: String (Optional)
-     *     product: String (Optional)
-     *     trait: String (Optional)
-     *     relativeMaturity (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     treatments (Optional): [
-     *         String (Optional)
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of crop product resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
cropIdsList<String>NoCropIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
brandsList<String>NoBrands of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
productsList<String>NoProducts of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
traitsList<String>NoTraits of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     cropIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     brand: String (Optional)
-     *     product: String (Optional)
-     *     trait: String (Optional)
-     *     relativeMaturity (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     treatments (Optional): [
-     *         String (Optional)
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of crop product resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
cropIdsList<String>NoCropIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
brandsList<String>NoBrands of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
productsList<String>NoProducts of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
traitsList<String>NoTraits of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     cropIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     brand: String (Optional)
-     *     product: String (Optional)
-     *     trait: String (Optional)
-     *     relativeMaturity (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     treatments (Optional): [
-     *         String (Optional)
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(requestOptions)); - } - - /** - * Gets a specified crop Product resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     cropIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     brand: String (Optional)
-     *     product: String (Optional)
-     *     trait: String (Optional)
-     *     relativeMaturity (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     treatments (Optional): [
-     *         String (Optional)
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param cropProductId Id of the crop Product. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified crop Product resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String cropProductId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), cropProductId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Gets a specified crop Product resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     cropIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     brand: String (Optional)
-     *     product: String (Optional)
-     *     trait: String (Optional)
-     *     relativeMaturity (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     treatments (Optional): [
-     *         String (Optional)
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param cropProductId Id of the crop Product. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified crop Product resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String cropProductId, RequestOptions requestOptions) { - return getWithResponseAsync(cropProductId, requestOptions).block(); - } - - /** - * Creates or updates a crop Product resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     cropIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     brand: String (Optional)
-     *     product: String (Optional)
-     *     trait: String (Optional)
-     *     relativeMaturity (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     treatments (Optional): [
-     *         String (Optional)
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     cropIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     brand: String (Optional)
-     *     product: String (Optional)
-     *     trait: String (Optional)
-     *     relativeMaturity (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     treatments (Optional): [
-     *         String (Optional)
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param cropProductId Id of the crop Product resource. - * @param cropProduct Crop Product resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of crop product resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String cropProductId, BinaryData cropProduct, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), cropProductId, - this.client.getServiceVersion().getVersion(), cropProduct, accept, requestOptions, context)); - } - - /** - * Creates or updates a crop Product resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     cropIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     brand: String (Optional)
-     *     product: String (Optional)
-     *     trait: String (Optional)
-     *     relativeMaturity (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     treatments (Optional): [
-     *         String (Optional)
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     cropIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     brand: String (Optional)
-     *     product: String (Optional)
-     *     trait: String (Optional)
-     *     relativeMaturity (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     treatments (Optional): [
-     *         String (Optional)
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param cropProductId Id of the crop Product resource. - * @param cropProduct Crop Product resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of crop product resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String cropProductId, BinaryData cropProduct, - RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(cropProductId, cropProduct, requestOptions).block(); - } - - /** - * Deletes a specified crop Product resource. - * - * @param cropProductId Id of the crop Product. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String cropProductId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), cropProductId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a specified crop Product resource. - * - * @param cropProductId Id of the crop Product. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String cropProductId, RequestOptions requestOptions) { - return deleteWithResponseAsync(cropProductId, requestOptions).block(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     cropIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     brand: String (Optional)
-     *     product: String (Optional)
-     *     trait: String (Optional)
-     *     relativeMaturity (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     treatments (Optional): [
-     *         String (Optional)
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/CropsImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/CropsImpl.java deleted file mode 100644 index 23e8649f1479..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/CropsImpl.java +++ /dev/null @@ -1,670 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in Crops. */ -public final class CropsImpl { - /** The proxy service used to perform REST calls. */ - private final CropsService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of CropsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CropsImpl(FarmBeatsClientImpl client) { - this.service = RestProxy.create(CropsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientCrops to be used by the proxy service to perform REST - * calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientCrops") - public interface CropsService { - @Get("/crops") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/crops/{cropId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @PathParam("cropId") String cropId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Patch("/crops/{cropId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("cropId") String cropId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData crop, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/crops/{cropId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("cropId") String cropId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of crop resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
phenotypesList<String>NoCrop phenotypes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
breedingMethodsList<String>NoBreeding method of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     phenotype: String (Optional)
-     *     breedingMethod: String(VARIETY/HYBRID/UNKNOWN) (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of crop resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
phenotypesList<String>NoCrop phenotypes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
breedingMethodsList<String>NoBreeding method of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     phenotype: String (Optional)
-     *     breedingMethod: String(VARIETY/HYBRID/UNKNOWN) (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of crop resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
phenotypesList<String>NoCrop phenotypes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
breedingMethodsList<String>NoBreeding method of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     phenotype: String (Optional)
-     *     breedingMethod: String(VARIETY/HYBRID/UNKNOWN) (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(requestOptions)); - } - - /** - * Gets a specified crop resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     phenotype: String (Optional)
-     *     breedingMethod: String(VARIETY/HYBRID/UNKNOWN) (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param cropId Id of the crop. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified crop resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String cropId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), cropId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Gets a specified crop resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     phenotype: String (Optional)
-     *     breedingMethod: String(VARIETY/HYBRID/UNKNOWN) (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param cropId Id of the crop. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified crop resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String cropId, RequestOptions requestOptions) { - return getWithResponseAsync(cropId, requestOptions).block(); - } - - /** - * Creates or updates a crop resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     phenotype: String (Optional)
-     *     breedingMethod: String(VARIETY/HYBRID/UNKNOWN) (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     phenotype: String (Optional)
-     *     breedingMethod: String(VARIETY/HYBRID/UNKNOWN) (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param cropId Id of the crop resource. - * @param crop Crop resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of crop resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String cropId, BinaryData crop, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), cropId, - this.client.getServiceVersion().getVersion(), crop, accept, requestOptions, context)); - } - - /** - * Creates or updates a crop resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     phenotype: String (Optional)
-     *     breedingMethod: String(VARIETY/HYBRID/UNKNOWN) (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     phenotype: String (Optional)
-     *     breedingMethod: String(VARIETY/HYBRID/UNKNOWN) (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param cropId Id of the crop resource. - * @param crop Crop resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of crop resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String cropId, BinaryData crop, - RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(cropId, crop, requestOptions).block(); - } - - /** - * Deletes Crop for given crop id. - * - * @param cropId Id of crop to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String cropId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), cropId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes Crop for given crop id. - * - * @param cropId Id of crop to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String cropId, RequestOptions requestOptions) { - return deleteWithResponseAsync(cropId, requestOptions).block(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     phenotype: String (Optional)
-     *     breedingMethod: String(VARIETY/HYBRID/UNKNOWN) (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/DeviceDataModelsImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/DeviceDataModelsImpl.java deleted file mode 100644 index d1b4c7654fb1..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/DeviceDataModelsImpl.java +++ /dev/null @@ -1,693 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DeviceDataModels. */ -public final class DeviceDataModelsImpl { - /** The proxy service used to perform REST calls. */ - private final DeviceDataModelsService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of DeviceDataModelsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DeviceDataModelsImpl(FarmBeatsClientImpl client) { - this.service - = RestProxy.create(DeviceDataModelsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientDeviceDataModels to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientDevic") - public interface DeviceDataModelsService { - @Get("/sensor-partners/{sensorPartnerId}/device-data-models") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @PathParam("sensorPartnerId") String sensorPartnerId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Patch("/sensor-partners/{sensorPartnerId}/device-data-models/{deviceDataModelId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("sensorPartnerId") String sensorPartnerId, - @PathParam("deviceDataModelId") String deviceDataModelId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData deviceDataModelObject, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/sensor-partners/{sensorPartnerId}/device-data-models/{deviceDataModelId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @PathParam("sensorPartnerId") String sensorPartnerId, - @PathParam("deviceDataModelId") String deviceDataModelId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Delete("/sensor-partners/{sensorPartnerId}/device-data-models/{deviceDataModelId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @PathParam("sensorPartnerId") String sensorPartnerId, - @PathParam("deviceDataModelId") String deviceDataModelId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of device data model resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     ports (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String sensorPartnerId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), sensorPartnerId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of device data model resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     ports (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String sensorPartnerId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(sensorPartnerId, requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of device data model resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     ports (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String sensorPartnerId, RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(sensorPartnerId, requestOptions)); - } - - /** - * Create a device data model entity. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     ports (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     ports (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param deviceDataModelId Id of the device data model. - * @param deviceDataModelObject Device data model object details. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return deviceDataModel API model along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String sensorPartnerId, String deviceDataModelId, - BinaryData deviceDataModelObject, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.createOrUpdate(this.client.getEndpoint(), sensorPartnerId, deviceDataModelId, - this.client.getServiceVersion().getVersion(), deviceDataModelObject, accept, requestOptions, context)); - } - - /** - * Create a device data model entity. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     ports (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     ports (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param deviceDataModelId Id of the device data model. - * @param deviceDataModelObject Device data model object details. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return deviceDataModel API model along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String sensorPartnerId, String deviceDataModelId, - BinaryData deviceDataModelObject, RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(sensorPartnerId, deviceDataModelId, deviceDataModelObject, - requestOptions).block(); - } - - /** - * Gets a device data model entity. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     ports (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param deviceDataModelId Id of the device data model resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a device data model entity along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String sensorPartnerId, String deviceDataModelId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), sensorPartnerId, - deviceDataModelId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Gets a device data model entity. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     ports (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param deviceDataModelId Id of the device data model resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a device data model entity along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String sensorPartnerId, String deviceDataModelId, - RequestOptions requestOptions) { - return getWithResponseAsync(sensorPartnerId, deviceDataModelId, requestOptions).block(); - } - - /** - * Deletes a device data model entity. - * - * @param sensorPartnerId Id of the sensor partner. - * @param deviceDataModelId Id of the device data model resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String sensorPartnerId, String deviceDataModelId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), sensorPartnerId, - deviceDataModelId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a device data model entity. - * - * @param sensorPartnerId Id of the sensor partner. - * @param deviceDataModelId Id of the device data model resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String sensorPartnerId, String deviceDataModelId, - RequestOptions requestOptions) { - return deleteWithResponseAsync(sensorPartnerId, deviceDataModelId, requestOptions).block(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     ports (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/DevicesImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/DevicesImpl.java deleted file mode 100644 index ee3b7e1c63b1..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/DevicesImpl.java +++ /dev/null @@ -1,705 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in Devices. */ -public final class DevicesImpl { - /** The proxy service used to perform REST calls. */ - private final DevicesService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of DevicesImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DevicesImpl(FarmBeatsClientImpl client) { - this.service = RestProxy.create(DevicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientDevices to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientDevic") - public interface DevicesService { - @Get("/sensor-partners/{sensorPartnerId}/devices") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @PathParam("sensorPartnerId") String sensorPartnerId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Patch("/sensor-partners/{sensorPartnerId}/devices/{deviceId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("sensorPartnerId") String sensorPartnerId, @PathParam("deviceId") String deviceId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData deviceDetails, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/sensor-partners/{sensorPartnerId}/devices/{deviceId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @PathParam("sensorPartnerId") String sensorPartnerId, @PathParam("deviceId") String deviceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/sensor-partners/{sensorPartnerId}/devices/{deviceId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @PathParam("sensorPartnerId") String sensorPartnerId, @PathParam("deviceId") String deviceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of device resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
parentDeviceIdsList<String>NoId's of the parent devices. Call {@link RequestOptions#addQueryParam} to add string to array.
deviceDataModelIdsList<String>NoId's of the device data models. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     deviceDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     type: String (Optional)
-     *     hardwareId: String (Optional)
-     *     reportingIntervalInSeconds: Integer (Optional)
-     *     parentDeviceId: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String sensorPartnerId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), sensorPartnerId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of device resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
parentDeviceIdsList<String>NoId's of the parent devices. Call {@link RequestOptions#addQueryParam} to add string to array.
deviceDataModelIdsList<String>NoId's of the device data models. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     deviceDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     type: String (Optional)
-     *     hardwareId: String (Optional)
-     *     reportingIntervalInSeconds: Integer (Optional)
-     *     parentDeviceId: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String sensorPartnerId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(sensorPartnerId, requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of device resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
parentDeviceIdsList<String>NoId's of the parent devices. Call {@link RequestOptions#addQueryParam} to add string to array.
deviceDataModelIdsList<String>NoId's of the device data models. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     deviceDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     type: String (Optional)
-     *     hardwareId: String (Optional)
-     *     reportingIntervalInSeconds: Integer (Optional)
-     *     parentDeviceId: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String sensorPartnerId, RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(sensorPartnerId, requestOptions)); - } - - /** - * Create a device entity. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     deviceDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     type: String (Optional)
-     *     hardwareId: String (Optional)
-     *     reportingIntervalInSeconds: Integer (Optional)
-     *     parentDeviceId: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     deviceDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     type: String (Optional)
-     *     hardwareId: String (Optional)
-     *     reportingIntervalInSeconds: Integer (Optional)
-     *     parentDeviceId: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param deviceId Id of the device resource. - * @param deviceDetails Device object details. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return device API model along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String sensorPartnerId, String deviceId, - BinaryData deviceDetails, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), sensorPartnerId, - deviceId, this.client.getServiceVersion().getVersion(), deviceDetails, accept, requestOptions, context)); - } - - /** - * Create a device entity. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     deviceDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     type: String (Optional)
-     *     hardwareId: String (Optional)
-     *     reportingIntervalInSeconds: Integer (Optional)
-     *     parentDeviceId: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     deviceDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     type: String (Optional)
-     *     hardwareId: String (Optional)
-     *     reportingIntervalInSeconds: Integer (Optional)
-     *     parentDeviceId: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param deviceId Id of the device resource. - * @param deviceDetails Device object details. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return device API model along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String sensorPartnerId, String deviceId, - BinaryData deviceDetails, RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(sensorPartnerId, deviceId, deviceDetails, requestOptions).block(); - } - - /** - * Gets a device entity. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     deviceDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     type: String (Optional)
-     *     hardwareId: String (Optional)
-     *     reportingIntervalInSeconds: Integer (Optional)
-     *     parentDeviceId: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param deviceId Id of the device resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a device entity along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String sensorPartnerId, String deviceId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), sensorPartnerId, deviceId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Gets a device entity. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     deviceDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     type: String (Optional)
-     *     hardwareId: String (Optional)
-     *     reportingIntervalInSeconds: Integer (Optional)
-     *     parentDeviceId: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param deviceId Id of the device resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a device entity along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String sensorPartnerId, String deviceId, - RequestOptions requestOptions) { - return getWithResponseAsync(sensorPartnerId, deviceId, requestOptions).block(); - } - - /** - * Deletes a device entity. - * - * @param sensorPartnerId Id of the sensor partner. - * @param deviceId Id of the device resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String sensorPartnerId, String deviceId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), sensorPartnerId, deviceId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a device entity. - * - * @param sensorPartnerId Id of the sensor partner. - * @param deviceId Id of the device resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String sensorPartnerId, String deviceId, RequestOptions requestOptions) { - return deleteWithResponseAsync(sensorPartnerId, deviceId, requestOptions).block(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     deviceDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     type: String (Optional)
-     *     hardwareId: String (Optional)
-     *     reportingIntervalInSeconds: Integer (Optional)
-     *     parentDeviceId: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/FarmBeatsClientImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/FarmBeatsClientImpl.java deleted file mode 100644 index 8cdacb211fa7..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/FarmBeatsClientImpl.java +++ /dev/null @@ -1,584 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.verticals.agrifood.farming.FarmBeatsServiceVersion; - -/** Initializes a new instance of the FarmBeatsClient type. */ -public final class FarmBeatsClientImpl { - /** The Azure FarmBeats account endpoint. */ - private final String endpoint; - - /** - * Gets The Azure FarmBeats account endpoint. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** Service version. */ - private final FarmBeatsServiceVersion serviceVersion; - - /** - * Gets Service version. - * - * @return the serviceVersion value. - */ - public FarmBeatsServiceVersion getServiceVersion() { - return this.serviceVersion; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - public SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The ApplicationDatasImpl object to access its operations. */ - private final ApplicationDatasImpl applicationDatas; - - /** - * Gets the ApplicationDatasImpl object to access its operations. - * - * @return the ApplicationDatasImpl object. - */ - public ApplicationDatasImpl getApplicationDatas() { - return this.applicationDatas; - } - - /** The AttachmentsImpl object to access its operations. */ - private final AttachmentsImpl attachments; - - /** - * Gets the AttachmentsImpl object to access its operations. - * - * @return the AttachmentsImpl object. - */ - public AttachmentsImpl getAttachments() { - return this.attachments; - } - - /** The BoundariesImpl object to access its operations. */ - private final BoundariesImpl boundaries; - - /** - * Gets the BoundariesImpl object to access its operations. - * - * @return the BoundariesImpl object. - */ - public BoundariesImpl getBoundaries() { - return this.boundaries; - } - - /** The CropProductsImpl object to access its operations. */ - private final CropProductsImpl cropProducts; - - /** - * Gets the CropProductsImpl object to access its operations. - * - * @return the CropProductsImpl object. - */ - public CropProductsImpl getCropProducts() { - return this.cropProducts; - } - - /** The CropsImpl object to access its operations. */ - private final CropsImpl crops; - - /** - * Gets the CropsImpl object to access its operations. - * - * @return the CropsImpl object. - */ - public CropsImpl getCrops() { - return this.crops; - } - - /** The DeviceDataModelsImpl object to access its operations. */ - private final DeviceDataModelsImpl deviceDataModels; - - /** - * Gets the DeviceDataModelsImpl object to access its operations. - * - * @return the DeviceDataModelsImpl object. - */ - public DeviceDataModelsImpl getDeviceDataModels() { - return this.deviceDataModels; - } - - /** The DevicesImpl object to access its operations. */ - private final DevicesImpl devices; - - /** - * Gets the DevicesImpl object to access its operations. - * - * @return the DevicesImpl object. - */ - public DevicesImpl getDevices() { - return this.devices; - } - - /** The FarmOperationsImpl object to access its operations. */ - private final FarmOperationsImpl farmOperations; - - /** - * Gets the FarmOperationsImpl object to access its operations. - * - * @return the FarmOperationsImpl object. - */ - public FarmOperationsImpl getFarmOperations() { - return this.farmOperations; - } - - /** The FarmsImpl object to access its operations. */ - private final FarmsImpl farms; - - /** - * Gets the FarmsImpl object to access its operations. - * - * @return the FarmsImpl object. - */ - public FarmsImpl getFarms() { - return this.farms; - } - - /** The FieldsImpl object to access its operations. */ - private final FieldsImpl fields; - - /** - * Gets the FieldsImpl object to access its operations. - * - * @return the FieldsImpl object. - */ - public FieldsImpl getFields() { - return this.fields; - } - - /** The HarvestDatasImpl object to access its operations. */ - private final HarvestDatasImpl harvestDatas; - - /** - * Gets the HarvestDatasImpl object to access its operations. - * - * @return the HarvestDatasImpl object. - */ - public HarvestDatasImpl getHarvestDatas() { - return this.harvestDatas; - } - - /** The ImageProcessingsImpl object to access its operations. */ - private final ImageProcessingsImpl imageProcessings; - - /** - * Gets the ImageProcessingsImpl object to access its operations. - * - * @return the ImageProcessingsImpl object. - */ - public ImageProcessingsImpl getImageProcessings() { - return this.imageProcessings; - } - - /** The InsightAttachmentsImpl object to access its operations. */ - private final InsightAttachmentsImpl insightAttachments; - - /** - * Gets the InsightAttachmentsImpl object to access its operations. - * - * @return the InsightAttachmentsImpl object. - */ - public InsightAttachmentsImpl getInsightAttachments() { - return this.insightAttachments; - } - - /** The InsightsImpl object to access its operations. */ - private final InsightsImpl insights; - - /** - * Gets the InsightsImpl object to access its operations. - * - * @return the InsightsImpl object. - */ - public InsightsImpl getInsights() { - return this.insights; - } - - /** The ManagementZonesImpl object to access its operations. */ - private final ManagementZonesImpl managementZones; - - /** - * Gets the ManagementZonesImpl object to access its operations. - * - * @return the ManagementZonesImpl object. - */ - public ManagementZonesImpl getManagementZones() { - return this.managementZones; - } - - /** The ModelInferencesImpl object to access its operations. */ - private final ModelInferencesImpl modelInferences; - - /** - * Gets the ModelInferencesImpl object to access its operations. - * - * @return the ModelInferencesImpl object. - */ - public ModelInferencesImpl getModelInferences() { - return this.modelInferences; - } - - /** The NutrientAnalysesImpl object to access its operations. */ - private final NutrientAnalysesImpl nutrientAnalyses; - - /** - * Gets the NutrientAnalysesImpl object to access its operations. - * - * @return the NutrientAnalysesImpl object. - */ - public NutrientAnalysesImpl getNutrientAnalyses() { - return this.nutrientAnalyses; - } - - /** The OAuthProvidersImpl object to access its operations. */ - private final OAuthProvidersImpl oAuthProviders; - - /** - * Gets the OAuthProvidersImpl object to access its operations. - * - * @return the OAuthProvidersImpl object. - */ - public OAuthProvidersImpl getOAuthProviders() { - return this.oAuthProviders; - } - - /** The OAuthTokensImpl object to access its operations. */ - private final OAuthTokensImpl oAuthTokens; - - /** - * Gets the OAuthTokensImpl object to access its operations. - * - * @return the OAuthTokensImpl object. - */ - public OAuthTokensImpl getOAuthTokens() { - return this.oAuthTokens; - } - - /** The PartiesImpl object to access its operations. */ - private final PartiesImpl parties; - - /** - * Gets the PartiesImpl object to access its operations. - * - * @return the PartiesImpl object. - */ - public PartiesImpl getParties() { - return this.parties; - } - - /** The PlantingDatasImpl object to access its operations. */ - private final PlantingDatasImpl plantingDatas; - - /** - * Gets the PlantingDatasImpl object to access its operations. - * - * @return the PlantingDatasImpl object. - */ - public PlantingDatasImpl getPlantingDatas() { - return this.plantingDatas; - } - - /** The PlantTissueAnalysesImpl object to access its operations. */ - private final PlantTissueAnalysesImpl plantTissueAnalyses; - - /** - * Gets the PlantTissueAnalysesImpl object to access its operations. - * - * @return the PlantTissueAnalysesImpl object. - */ - public PlantTissueAnalysesImpl getPlantTissueAnalyses() { - return this.plantTissueAnalyses; - } - - /** The PrescriptionMapsImpl object to access its operations. */ - private final PrescriptionMapsImpl prescriptionMaps; - - /** - * Gets the PrescriptionMapsImpl object to access its operations. - * - * @return the PrescriptionMapsImpl object. - */ - public PrescriptionMapsImpl getPrescriptionMaps() { - return this.prescriptionMaps; - } - - /** The PrescriptionsImpl object to access its operations. */ - private final PrescriptionsImpl prescriptions; - - /** - * Gets the PrescriptionsImpl object to access its operations. - * - * @return the PrescriptionsImpl object. - */ - public PrescriptionsImpl getPrescriptions() { - return this.prescriptions; - } - - /** The ScenesImpl object to access its operations. */ - private final ScenesImpl scenes; - - /** - * Gets the ScenesImpl object to access its operations. - * - * @return the ScenesImpl object. - */ - public ScenesImpl getScenes() { - return this.scenes; - } - - /** The SeasonalFieldsImpl object to access its operations. */ - private final SeasonalFieldsImpl seasonalFields; - - /** - * Gets the SeasonalFieldsImpl object to access its operations. - * - * @return the SeasonalFieldsImpl object. - */ - public SeasonalFieldsImpl getSeasonalFields() { - return this.seasonalFields; - } - - /** The SeasonsImpl object to access its operations. */ - private final SeasonsImpl seasons; - - /** - * Gets the SeasonsImpl object to access its operations. - * - * @return the SeasonsImpl object. - */ - public SeasonsImpl getSeasons() { - return this.seasons; - } - - /** The SensorDataModelsImpl object to access its operations. */ - private final SensorDataModelsImpl sensorDataModels; - - /** - * Gets the SensorDataModelsImpl object to access its operations. - * - * @return the SensorDataModelsImpl object. - */ - public SensorDataModelsImpl getSensorDataModels() { - return this.sensorDataModels; - } - - /** The SensorEventsImpl object to access its operations. */ - private final SensorEventsImpl sensorEvents; - - /** - * Gets the SensorEventsImpl object to access its operations. - * - * @return the SensorEventsImpl object. - */ - public SensorEventsImpl getSensorEvents() { - return this.sensorEvents; - } - - /** The SensorMappingsImpl object to access its operations. */ - private final SensorMappingsImpl sensorMappings; - - /** - * Gets the SensorMappingsImpl object to access its operations. - * - * @return the SensorMappingsImpl object. - */ - public SensorMappingsImpl getSensorMappings() { - return this.sensorMappings; - } - - /** The SensorPartnerIntegrationsImpl object to access its operations. */ - private final SensorPartnerIntegrationsImpl sensorPartnerIntegrations; - - /** - * Gets the SensorPartnerIntegrationsImpl object to access its operations. - * - * @return the SensorPartnerIntegrationsImpl object. - */ - public SensorPartnerIntegrationsImpl getSensorPartnerIntegrations() { - return this.sensorPartnerIntegrations; - } - - /** The SensorsImpl object to access its operations. */ - private final SensorsImpl sensors; - - /** - * Gets the SensorsImpl object to access its operations. - * - * @return the SensorsImpl object. - */ - public SensorsImpl getSensors() { - return this.sensors; - } - - /** The SolutionInferencesImpl object to access its operations. */ - private final SolutionInferencesImpl solutionInferences; - - /** - * Gets the SolutionInferencesImpl object to access its operations. - * - * @return the SolutionInferencesImpl object. - */ - public SolutionInferencesImpl getSolutionInferences() { - return this.solutionInferences; - } - - /** The TillageDatasImpl object to access its operations. */ - private final TillageDatasImpl tillageDatas; - - /** - * Gets the TillageDatasImpl object to access its operations. - * - * @return the TillageDatasImpl object. - */ - public TillageDatasImpl getTillageDatas() { - return this.tillageDatas; - } - - /** The WeathersImpl object to access its operations. */ - private final WeathersImpl weathers; - - /** - * Gets the WeathersImpl object to access its operations. - * - * @return the WeathersImpl object. - */ - public WeathersImpl getWeathers() { - return this.weathers; - } - - /** The WeatherDatasImpl object to access its operations. */ - private final WeatherDatasImpl weatherDatas; - - /** - * Gets the WeatherDatasImpl object to access its operations. - * - * @return the WeatherDatasImpl object. - */ - public WeatherDatasImpl getWeatherDatas() { - return this.weatherDatas; - } - - /** The ZonesImpl object to access its operations. */ - private final ZonesImpl zones; - - /** - * Gets the ZonesImpl object to access its operations. - * - * @return the ZonesImpl object. - */ - public ZonesImpl getZones() { - return this.zones; - } - - /** - * Initializes an instance of FarmBeatsClient client. - * - * @param endpoint The Azure FarmBeats account endpoint. - * @param serviceVersion Service version. - */ - public FarmBeatsClientImpl(String endpoint, FarmBeatsServiceVersion serviceVersion) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); - } - - /** - * Initializes an instance of FarmBeatsClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint The Azure FarmBeats account endpoint. - * @param serviceVersion Service version. - */ - public FarmBeatsClientImpl(HttpPipeline httpPipeline, String endpoint, FarmBeatsServiceVersion serviceVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); - } - - /** - * Initializes an instance of FarmBeatsClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint The Azure FarmBeats account endpoint. - * @param serviceVersion Service version. - */ - public FarmBeatsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - FarmBeatsServiceVersion serviceVersion) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - this.serviceVersion = serviceVersion; - this.applicationDatas = new ApplicationDatasImpl(this); - this.attachments = new AttachmentsImpl(this); - this.boundaries = new BoundariesImpl(this); - this.cropProducts = new CropProductsImpl(this); - this.crops = new CropsImpl(this); - this.deviceDataModels = new DeviceDataModelsImpl(this); - this.devices = new DevicesImpl(this); - this.farmOperations = new FarmOperationsImpl(this); - this.farms = new FarmsImpl(this); - this.fields = new FieldsImpl(this); - this.harvestDatas = new HarvestDatasImpl(this); - this.imageProcessings = new ImageProcessingsImpl(this); - this.insightAttachments = new InsightAttachmentsImpl(this); - this.insights = new InsightsImpl(this); - this.managementZones = new ManagementZonesImpl(this); - this.modelInferences = new ModelInferencesImpl(this); - this.nutrientAnalyses = new NutrientAnalysesImpl(this); - this.oAuthProviders = new OAuthProvidersImpl(this); - this.oAuthTokens = new OAuthTokensImpl(this); - this.parties = new PartiesImpl(this); - this.plantingDatas = new PlantingDatasImpl(this); - this.plantTissueAnalyses = new PlantTissueAnalysesImpl(this); - this.prescriptionMaps = new PrescriptionMapsImpl(this); - this.prescriptions = new PrescriptionsImpl(this); - this.scenes = new ScenesImpl(this); - this.seasonalFields = new SeasonalFieldsImpl(this); - this.seasons = new SeasonsImpl(this); - this.sensorDataModels = new SensorDataModelsImpl(this); - this.sensorEvents = new SensorEventsImpl(this); - this.sensorMappings = new SensorMappingsImpl(this); - this.sensorPartnerIntegrations = new SensorPartnerIntegrationsImpl(this); - this.sensors = new SensorsImpl(this); - this.solutionInferences = new SolutionInferencesImpl(this); - this.tillageDatas = new TillageDatasImpl(this); - this.weathers = new WeathersImpl(this); - this.weatherDatas = new WeatherDatasImpl(this); - this.zones = new ZonesImpl(this); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/FarmOperationsImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/FarmOperationsImpl.java deleted file mode 100644 index 6774033183fa..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/FarmOperationsImpl.java +++ /dev/null @@ -1,423 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.DefaultPollingStrategy; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.core.util.serializer.TypeReference; -import java.time.Duration; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in FarmOperations. */ -public final class FarmOperationsImpl { - /** The proxy service used to perform REST calls. */ - private final FarmOperationsService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of FarmOperationsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - FarmOperationsImpl(FarmBeatsClientImpl client) { - this.service - = RestProxy.create(FarmOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientFarmOperations to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientFarmO") - public interface FarmOperationsService { - @Put("/farm-operations/ingest-data/{jobId}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createDataIngestionJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BinaryData job, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/farm-operations/ingest-data/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDataIngestionJobDetails(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - } - - /** - * Create a farm operation data ingestion job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     authProviderId: String (Required)
-     *     operations (Optional): [
-     *         String (Optional)
-     *     ]
-     *     startYear: int (Required)
-     *     isIncremental: Boolean (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     authProviderId: String (Required)
-     *     operations (Optional): [
-     *         String (Optional)
-     *     ]
-     *     startYear: int (Required)
-     *     isIncremental: Boolean (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Job Id supplied by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of farm operation data ingestion job along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createDataIngestionJobWithResponseAsync(String jobId, BinaryData job, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createDataIngestionJob(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), job, accept, requestOptions, context)); - } - - /** - * Create a farm operation data ingestion job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     authProviderId: String (Required)
-     *     operations (Optional): [
-     *         String (Optional)
-     *     ]
-     *     startYear: int (Required)
-     *     isIncremental: Boolean (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     authProviderId: String (Required)
-     *     operations (Optional): [
-     *         String (Optional)
-     *     ]
-     *     startYear: int (Required)
-     *     isIncremental: Boolean (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Job Id supplied by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of farm operation data ingestion job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateDataIngestionJobAsync(String jobId, BinaryData job, - RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createDataIngestionJobWithResponseAsync(jobId, job, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Create a farm operation data ingestion job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     authProviderId: String (Required)
-     *     operations (Optional): [
-     *         String (Optional)
-     *     ]
-     *     startYear: int (Required)
-     *     isIncremental: Boolean (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     authProviderId: String (Required)
-     *     operations (Optional): [
-     *         String (Optional)
-     *     ]
-     *     startYear: int (Required)
-     *     isIncremental: Boolean (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Job Id supplied by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of farm operation data ingestion job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateDataIngestionJob(String jobId, BinaryData job, - RequestOptions requestOptions) { - return this.beginCreateDataIngestionJobAsync(jobId, job, requestOptions).getSyncPoller(); - } - - /** - * Get a farm operation data ingestion job. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     authProviderId: String (Required)
-     *     operations (Optional): [
-     *         String (Optional)
-     *     ]
-     *     startYear: int (Required)
-     *     isIncremental: Boolean (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a farm operation data ingestion job along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDataIngestionJobDetailsWithResponseAsync(String jobId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDataIngestionJobDetails(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get a farm operation data ingestion job. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     authProviderId: String (Required)
-     *     operations (Optional): [
-     *         String (Optional)
-     *     ]
-     *     startYear: int (Required)
-     *     isIncremental: Boolean (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a farm operation data ingestion job along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDataIngestionJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return getDataIngestionJobDetailsWithResponseAsync(jobId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/FarmsImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/FarmsImpl.java deleted file mode 100644 index efc7517a54fa..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/FarmsImpl.java +++ /dev/null @@ -1,1077 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.DefaultPollingStrategy; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.core.util.serializer.TypeReference; -import java.time.Duration; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in Farms. */ -public final class FarmsImpl { - /** The proxy service used to perform REST calls. */ - private final FarmsService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of FarmsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - FarmsImpl(FarmBeatsClientImpl client) { - this.service = RestProxy.create(FarmsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientFarms to be used by the proxy service to perform REST - * calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientFarms") - public interface FarmsService { - @Get("/farms") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Put("/farms/cascade-delete/{jobId}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createCascadeDeleteJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("partyId") String partyId, - @QueryParam("farmId") String farmId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/farms/cascade-delete/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getCascadeDeleteJobDetails(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/farms") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyId(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/farms/{farmId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("farmId") String farmId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Patch("/parties/{partyId}/farms/{farmId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @PathParam("farmId") String farmId, - @QueryParam("api-version") String apiVersion, @BodyParam("application/merge-patch+json") BinaryData farm, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Delete("/parties/{partyId}/farms/{farmId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("farmId") String farmId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyIdNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of farm resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of farm resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of farm resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(requestOptions)); - } - - /** - * Create a cascade delete job for specified farm. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param farmId ID of the farm to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of cascade delete job along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createCascadeDeleteJobWithResponseAsync(String jobId, String partyId, - String farmId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createCascadeDeleteJob(this.client.getEndpoint(), jobId, partyId, - farmId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Create a cascade delete job for specified farm. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param farmId ID of the farm to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJobAsync(String jobId, String partyId, - String farmId, RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createCascadeDeleteJobWithResponseAsync(jobId, partyId, farmId, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Create a cascade delete job for specified farm. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param farmId ID of the farm to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, String farmId, - RequestOptions requestOptions) { - return this.beginCreateCascadeDeleteJobAsync(jobId, partyId, farmId, requestOptions).getSyncPoller(); - } - - /** - * Get a cascade delete job for specified farm. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified farm along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponseAsync(String jobId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getCascadeDeleteJobDetails(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get a cascade delete job for specified farm. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified farm along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions).block(); - } - - /** - * Returns a paginated list of farm resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdSinglePageAsync(String partyId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByPartyId(this.client.getEndpoint(), partyId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of farm resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyIdAsync(String partyId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listByPartyIdSinglePageAsync(partyId, requestOptions), - nextLink -> listByPartyIdNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of farm resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(listByPartyIdAsync(partyId, requestOptions)); - } - - /** - * Gets a specified farm resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party resource. - * @param farmId ID of the farm resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified farm resource under a particular party along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String partyId, String farmId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), partyId, farmId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Gets a specified farm resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party resource. - * @param farmId ID of the farm resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified farm resource under a particular party along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String farmId, RequestOptions requestOptions) { - return getWithResponseAsync(partyId, farmId, requestOptions).block(); - } - - /** - * Creates or updates a farm resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party resource. - * @param farmId Id of the farm resource. - * @param farm Farm resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of farm resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String partyId, String farmId, BinaryData farm, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), partyId, farmId, - this.client.getServiceVersion().getVersion(), farm, accept, requestOptions, context)); - } - - /** - * Creates or updates a farm resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party resource. - * @param farmId Id of the farm resource. - * @param farm Farm resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of farm resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String farmId, BinaryData farm, - RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(partyId, farmId, farm, requestOptions).block(); - } - - /** - * Deletes a specified farm resource under a particular party. - * - * @param partyId Id of the party. - * @param farmId Id of the farm. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String partyId, String farmId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), partyId, farmId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a specified farm resource under a particular party. - * - * @param partyId Id of the party. - * @param farmId Id of the farm. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String farmId, RequestOptions requestOptions) { - return deleteWithResponseAsync(partyId, farmId, requestOptions).block(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listByPartyIdNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/FieldsImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/FieldsImpl.java deleted file mode 100644 index 6e1df40edd5d..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/FieldsImpl.java +++ /dev/null @@ -1,1097 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.DefaultPollingStrategy; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.core.util.serializer.TypeReference; -import java.time.Duration; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in Fields. */ -public final class FieldsImpl { - /** The proxy service used to perform REST calls. */ - private final FieldsService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of FieldsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - FieldsImpl(FarmBeatsClientImpl client) { - this.service = RestProxy.create(FieldsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientFields to be used by the proxy service to perform REST - * calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientField") - public interface FieldsService { - @Get("/fields") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/fields/cascade-delete/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getCascadeDeleteJobDetails(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Put("/fields/cascade-delete/{jobId}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createCascadeDeleteJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("partyId") String partyId, - @QueryParam("fieldId") String fieldId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/fields") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyId(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/fields/{fieldId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("fieldId") String fieldId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Patch("/parties/{partyId}/fields/{fieldId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @PathParam("fieldId") String fieldId, - @QueryParam("api-version") String apiVersion, @BodyParam("application/merge-patch+json") BinaryData field, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Delete("/parties/{partyId}/fields/{fieldId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("fieldId") String fieldId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyIdNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of field resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
farmIdsList<String>NoFarm Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     farmId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of field resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
farmIdsList<String>NoFarm Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     farmId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of field resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
farmIdsList<String>NoFarm Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     farmId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(requestOptions)); - } - - /** - * Get a cascade delete job for specified field. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified field along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponseAsync(String jobId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getCascadeDeleteJobDetails(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get a cascade delete job for specified field. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified field along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions).block(); - } - - /** - * Create a cascade delete job for specified field. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param fieldId ID of the field to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of cascade delete job along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createCascadeDeleteJobWithResponseAsync(String jobId, String partyId, - String fieldId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createCascadeDeleteJob(this.client.getEndpoint(), jobId, partyId, - fieldId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Create a cascade delete job for specified field. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param fieldId ID of the field to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJobAsync(String jobId, String partyId, - String fieldId, RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createCascadeDeleteJobWithResponseAsync(jobId, partyId, fieldId, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Create a cascade delete job for specified field. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param fieldId ID of the field to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, String fieldId, - RequestOptions requestOptions) { - return this.beginCreateCascadeDeleteJobAsync(jobId, partyId, fieldId, requestOptions).getSyncPoller(); - } - - /** - * Returns a paginated list of field resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
farmIdsList<String>NoFarm Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     farmId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdSinglePageAsync(String partyId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByPartyId(this.client.getEndpoint(), partyId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of field resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
farmIdsList<String>NoFarm Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     farmId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyIdAsync(String partyId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listByPartyIdSinglePageAsync(partyId, requestOptions), - nextLink -> listByPartyIdNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of field resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
farmIdsList<String>NoFarm Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     farmId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(listByPartyIdAsync(partyId, requestOptions)); - } - - /** - * Gets a specified field resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     farmId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param fieldId Id of the field. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified field resource under a particular party along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String partyId, String fieldId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), partyId, fieldId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Gets a specified field resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     farmId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param fieldId Id of the field. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified field resource under a particular party along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String fieldId, RequestOptions requestOptions) { - return getWithResponseAsync(partyId, fieldId, requestOptions).block(); - } - - /** - * Creates or Updates a field resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     farmId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     farmId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party resource. - * @param fieldId Id of the field resource. - * @param field Field resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of field resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String partyId, String fieldId, BinaryData field, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), partyId, fieldId, - this.client.getServiceVersion().getVersion(), field, accept, requestOptions, context)); - } - - /** - * Creates or Updates a field resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     farmId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     farmId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party resource. - * @param fieldId Id of the field resource. - * @param field Field resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of field resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String fieldId, BinaryData field, - RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(partyId, fieldId, field, requestOptions).block(); - } - - /** - * Deletes a specified field resource under a particular party. - * - * @param partyId Id of the party. - * @param fieldId Id of the field. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String partyId, String fieldId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), partyId, fieldId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a specified field resource under a particular party. - * - * @param partyId Id of the party. - * @param fieldId Id of the field. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String fieldId, RequestOptions requestOptions) { - return deleteWithResponseAsync(partyId, fieldId, requestOptions).block(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     farmId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     farmId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listByPartyIdNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/HarvestDatasImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/HarvestDatasImpl.java deleted file mode 100644 index 9d72a20cafb2..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/HarvestDatasImpl.java +++ /dev/null @@ -1,1576 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.DefaultPollingStrategy; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.core.util.serializer.TypeReference; -import java.time.Duration; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in HarvestDatas. */ -public final class HarvestDatasImpl { - /** The proxy service used to perform REST calls. */ - private final HarvestDatasService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of HarvestDatasImpl. - * - * @param client the instance of the service client containing this operation class. - */ - HarvestDatasImpl(FarmBeatsClientImpl client) { - this.service - = RestProxy.create(HarvestDatasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientHarvestDatas to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientHarve") - public interface HarvestDatasService { - @Get("/harvest-data") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Put("/harvest-data/cascade-delete/{jobId}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createCascadeDeleteJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("partyId") String partyId, - @QueryParam("harvestDataId") String harvestDataId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/harvest-data/cascade-delete/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getCascadeDeleteJobDetails(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/harvest-data") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyId(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/harvest-data/{harvestDataId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("harvestDataId") String harvestDataId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Patch("/parties/{partyId}/harvest-data/{harvestDataId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @PathParam("harvestDataId") String harvestDataId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData harvestData, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/parties/{partyId}/harvest-data/{harvestDataId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("harvestDataId") String harvestDataId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyIdNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of harvest data resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minTotalYieldDoubleNoMinimum Yield value(inclusive).
maxTotalYieldDoubleNoMaximum Yield value (inclusive).
minAvgYieldDoubleNoMinimum AvgYield value(inclusive).
maxAvgYieldDoubleNoMaximum AvgYield value (inclusive).
minTotalWetMassDoubleNoMinimum Total WetMass value(inclusive).
maxTotalWetMassDoubleNoMaximum Total WetMass value (inclusive).
minAvgWetMassDoubleNoMinimum AvgWetMass value(inclusive).
maxAvgWetMassDoubleNoMaximum AvgWetMass value (inclusive).
minAvgMoistureDoubleNoMinimum AvgMoisture value(inclusive).
maxAvgMoistureDoubleNoMaximum AvgMoisture value (inclusive).
minAvgSpeedDoubleNoMinimum AvgSpeed value(inclusive).
maxAvgSpeedDoubleNoMaximum AvgSpeed value (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     totalYield (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     avgYield (Optional): (recursive schema, see avgYield above)
-     *     totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *     avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *     avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *     avgSpeed (Optional): (recursive schema, see avgSpeed above)
-     *     harvestProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalYield (Optional): (recursive schema, see totalYield above)
-     *             avgYield (Optional): (recursive schema, see avgYield above)
-     *             avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *             totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *             avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of harvest data resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minTotalYieldDoubleNoMinimum Yield value(inclusive).
maxTotalYieldDoubleNoMaximum Yield value (inclusive).
minAvgYieldDoubleNoMinimum AvgYield value(inclusive).
maxAvgYieldDoubleNoMaximum AvgYield value (inclusive).
minTotalWetMassDoubleNoMinimum Total WetMass value(inclusive).
maxTotalWetMassDoubleNoMaximum Total WetMass value (inclusive).
minAvgWetMassDoubleNoMinimum AvgWetMass value(inclusive).
maxAvgWetMassDoubleNoMaximum AvgWetMass value (inclusive).
minAvgMoistureDoubleNoMinimum AvgMoisture value(inclusive).
maxAvgMoistureDoubleNoMaximum AvgMoisture value (inclusive).
minAvgSpeedDoubleNoMinimum AvgSpeed value(inclusive).
maxAvgSpeedDoubleNoMaximum AvgSpeed value (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     totalYield (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     avgYield (Optional): (recursive schema, see avgYield above)
-     *     totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *     avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *     avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *     avgSpeed (Optional): (recursive schema, see avgSpeed above)
-     *     harvestProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalYield (Optional): (recursive schema, see totalYield above)
-     *             avgYield (Optional): (recursive schema, see avgYield above)
-     *             avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *             totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *             avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of harvest data resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minTotalYieldDoubleNoMinimum Yield value(inclusive).
maxTotalYieldDoubleNoMaximum Yield value (inclusive).
minAvgYieldDoubleNoMinimum AvgYield value(inclusive).
maxAvgYieldDoubleNoMaximum AvgYield value (inclusive).
minTotalWetMassDoubleNoMinimum Total WetMass value(inclusive).
maxTotalWetMassDoubleNoMaximum Total WetMass value (inclusive).
minAvgWetMassDoubleNoMinimum AvgWetMass value(inclusive).
maxAvgWetMassDoubleNoMaximum AvgWetMass value (inclusive).
minAvgMoistureDoubleNoMinimum AvgMoisture value(inclusive).
maxAvgMoistureDoubleNoMaximum AvgMoisture value (inclusive).
minAvgSpeedDoubleNoMinimum AvgSpeed value(inclusive).
maxAvgSpeedDoubleNoMaximum AvgSpeed value (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     totalYield (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     avgYield (Optional): (recursive schema, see avgYield above)
-     *     totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *     avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *     avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *     avgSpeed (Optional): (recursive schema, see avgSpeed above)
-     *     harvestProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalYield (Optional): (recursive schema, see totalYield above)
-     *             avgYield (Optional): (recursive schema, see avgYield above)
-     *             avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *             totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *             avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(requestOptions)); - } - - /** - * Create cascade delete job for harvest data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param partyId Id of the party. - * @param harvestDataId Id of the harvest data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of cascade delete job along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createCascadeDeleteJobWithResponseAsync(String jobId, String partyId, - String harvestDataId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createCascadeDeleteJob(this.client.getEndpoint(), jobId, partyId, - harvestDataId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Create cascade delete job for harvest data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param partyId Id of the party. - * @param harvestDataId Id of the harvest data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJobAsync(String jobId, String partyId, - String harvestDataId, RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createCascadeDeleteJobWithResponseAsync(jobId, partyId, harvestDataId, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Create cascade delete job for harvest data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param partyId Id of the party. - * @param harvestDataId Id of the harvest data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, - String harvestDataId, RequestOptions requestOptions) { - return this.beginCreateCascadeDeleteJobAsync(jobId, partyId, harvestDataId, requestOptions).getSyncPoller(); - } - - /** - * Get cascade delete job for harvest data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for harvest data resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponseAsync(String jobId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getCascadeDeleteJobDetails(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get cascade delete job for harvest data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for harvest data resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions).block(); - } - - /** - * Returns a paginated list of harvest data resources under a particular farm. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minTotalYieldDoubleNoMinimum Yield value(inclusive).
maxTotalYieldDoubleNoMaximum Yield value (inclusive).
minAvgYieldDoubleNoMinimum AvgYield value(inclusive).
maxAvgYieldDoubleNoMaximum AvgYield value (inclusive).
minTotalWetMassDoubleNoMinimum Total WetMass value(inclusive).
maxTotalWetMassDoubleNoMaximum Total WetMass value (inclusive).
minAvgWetMassDoubleNoMinimum AvgWetMass value(inclusive).
maxAvgWetMassDoubleNoMaximum AvgWetMass value (inclusive).
minAvgMoistureDoubleNoMinimum AvgMoisture value(inclusive).
maxAvgMoistureDoubleNoMaximum AvgMoisture value (inclusive).
minAvgSpeedDoubleNoMinimum AvgSpeed value(inclusive).
maxAvgSpeedDoubleNoMaximum AvgSpeed value (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     totalYield (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     avgYield (Optional): (recursive schema, see avgYield above)
-     *     totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *     avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *     avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *     avgSpeed (Optional): (recursive schema, see avgSpeed above)
-     *     harvestProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalYield (Optional): (recursive schema, see totalYield above)
-     *             avgYield (Optional): (recursive schema, see avgYield above)
-     *             avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *             totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *             avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdSinglePageAsync(String partyId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByPartyId(this.client.getEndpoint(), partyId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of harvest data resources under a particular farm. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minTotalYieldDoubleNoMinimum Yield value(inclusive).
maxTotalYieldDoubleNoMaximum Yield value (inclusive).
minAvgYieldDoubleNoMinimum AvgYield value(inclusive).
maxAvgYieldDoubleNoMaximum AvgYield value (inclusive).
minTotalWetMassDoubleNoMinimum Total WetMass value(inclusive).
maxTotalWetMassDoubleNoMaximum Total WetMass value (inclusive).
minAvgWetMassDoubleNoMinimum AvgWetMass value(inclusive).
maxAvgWetMassDoubleNoMaximum AvgWetMass value (inclusive).
minAvgMoistureDoubleNoMinimum AvgMoisture value(inclusive).
maxAvgMoistureDoubleNoMaximum AvgMoisture value (inclusive).
minAvgSpeedDoubleNoMinimum AvgSpeed value(inclusive).
maxAvgSpeedDoubleNoMaximum AvgSpeed value (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     totalYield (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     avgYield (Optional): (recursive schema, see avgYield above)
-     *     totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *     avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *     avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *     avgSpeed (Optional): (recursive schema, see avgSpeed above)
-     *     harvestProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalYield (Optional): (recursive schema, see totalYield above)
-     *             avgYield (Optional): (recursive schema, see avgYield above)
-     *             avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *             totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *             avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyIdAsync(String partyId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listByPartyIdSinglePageAsync(partyId, requestOptions), - nextLink -> listByPartyIdNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of harvest data resources under a particular farm. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minTotalYieldDoubleNoMinimum Yield value(inclusive).
maxTotalYieldDoubleNoMaximum Yield value (inclusive).
minAvgYieldDoubleNoMinimum AvgYield value(inclusive).
maxAvgYieldDoubleNoMaximum AvgYield value (inclusive).
minTotalWetMassDoubleNoMinimum Total WetMass value(inclusive).
maxTotalWetMassDoubleNoMaximum Total WetMass value (inclusive).
minAvgWetMassDoubleNoMinimum AvgWetMass value(inclusive).
maxAvgWetMassDoubleNoMaximum AvgWetMass value (inclusive).
minAvgMoistureDoubleNoMinimum AvgMoisture value(inclusive).
maxAvgMoistureDoubleNoMaximum AvgMoisture value (inclusive).
minAvgSpeedDoubleNoMinimum AvgSpeed value(inclusive).
maxAvgSpeedDoubleNoMaximum AvgSpeed value (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     totalYield (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     avgYield (Optional): (recursive schema, see avgYield above)
-     *     totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *     avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *     avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *     avgSpeed (Optional): (recursive schema, see avgSpeed above)
-     *     harvestProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalYield (Optional): (recursive schema, see totalYield above)
-     *             avgYield (Optional): (recursive schema, see avgYield above)
-     *             avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *             totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *             avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(listByPartyIdAsync(partyId, requestOptions)); - } - - /** - * Get a specified harvest data resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     totalYield (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     avgYield (Optional): (recursive schema, see avgYield above)
-     *     totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *     avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *     avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *     avgSpeed (Optional): (recursive schema, see avgSpeed above)
-     *     harvestProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalYield (Optional): (recursive schema, see totalYield above)
-     *             avgYield (Optional): (recursive schema, see avgYield above)
-     *             avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *             totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *             avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party resource. - * @param harvestDataId ID of the harvest data resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified harvest data resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String partyId, String harvestDataId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), partyId, harvestDataId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get a specified harvest data resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     totalYield (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     avgYield (Optional): (recursive schema, see avgYield above)
-     *     totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *     avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *     avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *     avgSpeed (Optional): (recursive schema, see avgSpeed above)
-     *     harvestProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalYield (Optional): (recursive schema, see totalYield above)
-     *             avgYield (Optional): (recursive schema, see avgYield above)
-     *             avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *             totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *             avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party resource. - * @param harvestDataId ID of the harvest data resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified harvest data resource under a particular party along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String harvestDataId, RequestOptions requestOptions) { - return getWithResponseAsync(partyId, harvestDataId, requestOptions).block(); - } - - /** - * Creates or updates harvest data resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     totalYield (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     avgYield (Optional): (recursive schema, see avgYield above)
-     *     totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *     avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *     avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *     avgSpeed (Optional): (recursive schema, see avgSpeed above)
-     *     harvestProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalYield (Optional): (recursive schema, see totalYield above)
-     *             avgYield (Optional): (recursive schema, see avgYield above)
-     *             avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *             totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *             avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     totalYield (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     avgYield (Optional): (recursive schema, see avgYield above)
-     *     totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *     avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *     avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *     avgSpeed (Optional): (recursive schema, see avgSpeed above)
-     *     harvestProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalYield (Optional): (recursive schema, see totalYield above)
-     *             avgYield (Optional): (recursive schema, see avgYield above)
-     *             avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *             totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *             avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the party. - * @param harvestDataId ID of the harvest data resource. - * @param harvestData Harvest data resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of harvest data resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String partyId, String harvestDataId, - BinaryData harvestData, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), partyId, harvestDataId, - this.client.getServiceVersion().getVersion(), harvestData, accept, requestOptions, context)); - } - - /** - * Creates or updates harvest data resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     totalYield (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     avgYield (Optional): (recursive schema, see avgYield above)
-     *     totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *     avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *     avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *     avgSpeed (Optional): (recursive schema, see avgSpeed above)
-     *     harvestProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalYield (Optional): (recursive schema, see totalYield above)
-     *             avgYield (Optional): (recursive schema, see avgYield above)
-     *             avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *             totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *             avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     totalYield (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     avgYield (Optional): (recursive schema, see avgYield above)
-     *     totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *     avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *     avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *     avgSpeed (Optional): (recursive schema, see avgSpeed above)
-     *     harvestProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalYield (Optional): (recursive schema, see totalYield above)
-     *             avgYield (Optional): (recursive schema, see avgYield above)
-     *             avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *             totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *             avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the party. - * @param harvestDataId ID of the harvest data resource. - * @param harvestData Harvest data resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of harvest data resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String harvestDataId, BinaryData harvestData, - RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(partyId, harvestDataId, harvestData, requestOptions).block(); - } - - /** - * Deletes a specified harvest data resource under a particular party. - * - * @param partyId ID of the associated party resource. - * @param harvestDataId ID of the harvest data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String partyId, String harvestDataId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), partyId, harvestDataId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a specified harvest data resource under a particular party. - * - * @param partyId ID of the associated party resource. - * @param harvestDataId ID of the harvest data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String harvestDataId, RequestOptions requestOptions) { - return deleteWithResponseAsync(partyId, harvestDataId, requestOptions).block(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     totalYield (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     avgYield (Optional): (recursive schema, see avgYield above)
-     *     totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *     avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *     avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *     avgSpeed (Optional): (recursive schema, see avgSpeed above)
-     *     harvestProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalYield (Optional): (recursive schema, see totalYield above)
-     *             avgYield (Optional): (recursive schema, see avgYield above)
-     *             avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *             totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *             avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     totalYield (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     avgYield (Optional): (recursive schema, see avgYield above)
-     *     totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *     avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *     avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *     avgSpeed (Optional): (recursive schema, see avgSpeed above)
-     *     harvestProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalYield (Optional): (recursive schema, see totalYield above)
-     *             avgYield (Optional): (recursive schema, see avgYield above)
-     *             avgMoisture (Optional): (recursive schema, see avgMoisture above)
-     *             totalWetMass (Optional): (recursive schema, see totalWetMass above)
-     *             avgWetMass (Optional): (recursive schema, see avgWetMass above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listByPartyIdNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/ImageProcessingsImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/ImageProcessingsImpl.java deleted file mode 100644 index bfa5f206be92..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/ImageProcessingsImpl.java +++ /dev/null @@ -1,407 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.DefaultPollingStrategy; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.core.util.serializer.TypeReference; -import java.time.Duration; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ImageProcessings. */ -public final class ImageProcessingsImpl { - /** The proxy service used to perform REST calls. */ - private final ImageProcessingsService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of ImageProcessingsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ImageProcessingsImpl(FarmBeatsClientImpl client) { - this.service - = RestProxy.create(ImageProcessingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientImageProcessings to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientImage") - public interface ImageProcessingsService { - @Put("/image-processing/rasterize/{jobId}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createRasterizeJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BinaryData job, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/image-processing/rasterize/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getRasterizeJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - } - - /** - * Create a ImageProcessing Rasterize job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     shapefileAttachmentId: String (Required)
-     *     shapefileColumnNames (Required): [
-     *         String (Required)
-     *     ]
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     shapefileAttachmentId: String (Required)
-     *     shapefileColumnNames (Required): [
-     *         String (Required)
-     *     ]
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId JobId provided by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return image Processing Rasterize Job to convert shapefile into tiff file along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createRasterizeJobWithResponseAsync(String jobId, BinaryData job, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createRasterizeJob(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), job, accept, requestOptions, context)); - } - - /** - * Create a ImageProcessing Rasterize job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     shapefileAttachmentId: String (Required)
-     *     shapefileColumnNames (Required): [
-     *         String (Required)
-     *     ]
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     shapefileAttachmentId: String (Required)
-     *     shapefileColumnNames (Required): [
-     *         String (Required)
-     *     ]
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId JobId provided by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of image Processing Rasterize Job to convert shapefile into tiff file. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateRasterizeJobAsync(String jobId, BinaryData job, - RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createRasterizeJobWithResponseAsync(jobId, job, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Create a ImageProcessing Rasterize job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     shapefileAttachmentId: String (Required)
-     *     shapefileColumnNames (Required): [
-     *         String (Required)
-     *     ]
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     shapefileAttachmentId: String (Required)
-     *     shapefileColumnNames (Required): [
-     *         String (Required)
-     *     ]
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId JobId provided by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of image Processing Rasterize Job to convert shapefile into tiff file. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateRasterizeJob(String jobId, BinaryData job, - RequestOptions requestOptions) { - return this.beginCreateRasterizeJobAsync(jobId, job, requestOptions).getSyncPoller(); - } - - /** - * Get ImageProcessing Rasterize job's details. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     shapefileAttachmentId: String (Required)
-     *     shapefileColumnNames (Required): [
-     *         String (Required)
-     *     ]
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return imageProcessing Rasterize job's details along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRasterizeJobWithResponseAsync(String jobId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getRasterizeJob(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get ImageProcessing Rasterize job's details. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     shapefileAttachmentId: String (Required)
-     *     shapefileColumnNames (Required): [
-     *         String (Required)
-     *     ]
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return imageProcessing Rasterize job's details along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getRasterizeJobWithResponse(String jobId, RequestOptions requestOptions) { - return getRasterizeJobWithResponseAsync(jobId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/InsightAttachmentsImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/InsightAttachmentsImpl.java deleted file mode 100644 index ed9f9672cd46..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/InsightAttachmentsImpl.java +++ /dev/null @@ -1,748 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in InsightAttachments. */ -public final class InsightAttachmentsImpl { - /** The proxy service used to perform REST calls. */ - private final InsightAttachmentsService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of InsightAttachmentsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - InsightAttachmentsImpl(FarmBeatsClientImpl client) { - this.service = RestProxy.create(InsightAttachmentsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientInsightAttachments to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientInsig") - public interface InsightAttachmentsService { - @Get("/parties/{partyId}/models/{modelId}/resource-types/{resourceType}/resources/{resourceId}/insight-attachments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyIdModelIdAndResource(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @PathParam("modelId") String modelId, - @PathParam("resourceType") String resourceType, @PathParam("resourceId") String resourceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - // @Multipart not supported by RestProxy - @Patch("/parties/{partyId}/models/{modelId}/resource-types/{resourceType}/resources/{resourceId}/insight-attachments/{insightAttachmentId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @PathParam("modelId") String modelId, - @PathParam("resourceType") String resourceType, @PathParam("resourceId") String resourceId, - @PathParam("insightAttachmentId") String insightAttachmentId, @QueryParam("api-version") String apiVersion, - @BodyParam("multipart/form-data") BinaryData insightId, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/models/{modelId}/resource-types/{resourceType}/resources/{resourceId}/insight-attachments/{insightAttachmentId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("modelId") String modelId, @PathParam("resourceType") String resourceType, - @PathParam("resourceId") String resourceId, @PathParam("insightAttachmentId") String insightAttachmentId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/parties/{partyId}/models/{modelId}/resource-types/{resourceType}/resources/{resourceId}/insight-attachments/{insightAttachmentId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("modelId") String modelId, @PathParam("resourceType") String resourceType, - @PathParam("resourceId") String resourceId, @PathParam("insightAttachmentId") String insightAttachmentId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/models/{modelId}/resource-types/{resourceType}/resources/{resourceId}/insight-attachments/{insightAttachmentId}/file") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> download(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @PathParam("modelId") String modelId, - @PathParam("resourceType") String resourceType, @PathParam("resourceId") String resourceId, - @PathParam("insightAttachmentId") String insightAttachmentId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyIdModelIdAndResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - } - - /** - * Returns a paginated list of insight resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
insightIdsList<String>NoList of insight IDs. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     insightId: String (Required)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdModelIdAndResourceSinglePageAsync(String partyId, - String modelId, String resourceType, String resourceId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByPartyIdModelIdAndResource(this.client.getEndpoint(), partyId, modelId, - resourceType, resourceId, this.client.getServiceVersion().getVersion(), accept, requestOptions, - context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of insight resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
insightIdsList<String>NoList of insight IDs. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     insightId: String (Required)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyIdModelIdAndResourceAsync(String partyId, String modelId, - String resourceType, String resourceId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>( - () -> listByPartyIdModelIdAndResourceSinglePageAsync(partyId, modelId, resourceType, resourceId, - requestOptions), - nextLink -> listByPartyIdModelIdAndResourceNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of insight resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
insightIdsList<String>NoList of insight IDs. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     insightId: String (Required)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyIdModelIdAndResource(String partyId, String modelId, - String resourceType, String resourceId, RequestOptions requestOptions) { - return new PagedIterable<>( - listByPartyIdModelIdAndResourceAsync(partyId, modelId, resourceType, resourceId, requestOptions)); - } - - /** - * Creates or updates insight entity. - * - *

Header Parameters - * - * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: "multipart/form-data".
- * - * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Request Body Schema - * - *

{@code
-     * BinaryData
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     insightId: String (Required)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightAttachmentId Id of the insight resource. - * @param insightId InsightID for this InsightAttachment. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of insight attachment resource along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String partyId, String modelId, - String resourceType, String resourceId, String insightAttachmentId, BinaryData insightId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), partyId, modelId, - resourceType, resourceId, insightAttachmentId, this.client.getServiceVersion().getVersion(), insightId, - accept, requestOptions, context)); - } - - /** - * Creates or updates insight entity. - * - *

Header Parameters - * - * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: "multipart/form-data".
- * - * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Request Body Schema - * - *

{@code
-     * BinaryData
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     insightId: String (Required)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightAttachmentId Id of the insight resource. - * @param insightId InsightID for this InsightAttachment. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of insight attachment resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String modelId, String resourceType, - String resourceId, String insightAttachmentId, BinaryData insightId, RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(partyId, modelId, resourceType, resourceId, insightAttachmentId, - insightId, requestOptions).block(); - } - - /** - * Gets a specified insight resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     insightId: String (Required)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightAttachmentId Id of the insight attachment resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified insight resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String partyId, String modelId, String resourceType, - String resourceId, String insightAttachmentId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), partyId, modelId, resourceType, resourceId, - insightAttachmentId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Gets a specified insight resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     insightId: String (Required)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightAttachmentId Id of the insight attachment resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified insight resource under a particular party along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String modelId, String resourceType, String resourceId, - String insightAttachmentId, RequestOptions requestOptions) { - return getWithResponseAsync(partyId, modelId, resourceType, resourceId, insightAttachmentId, requestOptions) - .block(); - } - - /** - * Deletes a specified insight resource. - * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightAttachmentId Id of the insight attachment resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String partyId, String modelId, String resourceType, - String resourceId, String insightAttachmentId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.delete(this.client.getEndpoint(), partyId, modelId, resourceType, resourceId, - insightAttachmentId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a specified insight resource. - * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightAttachmentId Id of the insight attachment resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String modelId, String resourceType, String resourceId, - String insightAttachmentId, RequestOptions requestOptions) { - return deleteWithResponseAsync(partyId, modelId, resourceType, resourceId, insightAttachmentId, requestOptions) - .block(); - } - - /** - * Downloads and returns insight-attachment as response for the given input filePath. - * - *

Response Body Schema - * - *

{@code
-     * BinaryData
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightAttachmentId Id of the insight attachment resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> downloadWithResponseAsync(String partyId, String modelId, String resourceType, - String resourceId, String insightAttachmentId, RequestOptions requestOptions) { - final String accept = "application/json, application/octet-stream"; - return FluxUtil.withContext( - context -> service.download(this.client.getEndpoint(), partyId, modelId, resourceType, resourceId, - insightAttachmentId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Downloads and returns insight-attachment as response for the given input filePath. - * - *

Response Body Schema - * - *

{@code
-     * BinaryData
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightAttachmentId Id of the insight attachment resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response downloadWithResponse(String partyId, String modelId, String resourceType, - String resourceId, String insightAttachmentId, RequestOptions requestOptions) { - return downloadWithResponseAsync(partyId, modelId, resourceType, resourceId, insightAttachmentId, - requestOptions).block(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     insightId: String (Required)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     originalFileName: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdModelIdAndResourceNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByPartyIdModelIdAndResourceNext(nextLink, this.client.getEndpoint(), - accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/InsightsImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/InsightsImpl.java deleted file mode 100644 index aa8a9e3a5efc..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/InsightsImpl.java +++ /dev/null @@ -1,1041 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.DefaultPollingStrategy; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.core.util.serializer.TypeReference; -import java.time.Duration; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in Insights. */ -public final class InsightsImpl { - /** The proxy service used to perform REST calls. */ - private final InsightsService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of InsightsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - InsightsImpl(FarmBeatsClientImpl client) { - this.service = RestProxy.create(InsightsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientInsights to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientInsig") - public interface InsightsService { - @Put("/insights/cascade-delete/{jobId}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createCascadeDeleteJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("partyId") String partyId, - @QueryParam("modelId") String modelId, @QueryParam("resourceType") String resourceType, - @QueryParam("resourceId") String resourceId, @QueryParam("insightId") String insightId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/insights/cascade-delete/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getCascadeDeleteJobDetails(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/models/{modelId}/resource-types/{resourceType}/resources/{resourceId}/insights") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyIdModelIdAndResource(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @PathParam("modelId") String modelId, - @PathParam("resourceType") String resourceType, @PathParam("resourceId") String resourceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Patch("/parties/{partyId}/models/{modelId}/resource-types/{resourceType}/resources/{resourceId}/insights/{insightId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @PathParam("modelId") String modelId, - @PathParam("resourceType") String resourceType, @PathParam("resourceId") String resourceId, - @PathParam("insightId") String insightId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData insightData, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/models/{modelId}/resource-types/{resourceType}/resources/{resourceId}/insights/{insightId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("modelId") String modelId, @PathParam("resourceType") String resourceType, - @PathParam("resourceId") String resourceId, @PathParam("insightId") String insightId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/parties/{partyId}/models/{modelId}/resource-types/{resourceType}/resources/{resourceId}/insights/{insightId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("modelId") String modelId, @PathParam("resourceType") String resourceType, - @PathParam("resourceId") String resourceId, @PathParam("insightId") String insightId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyIdModelIdAndResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - } - - /** - * Create a cascade delete job for insights specified partyId/modelId/resourceType/resourceId. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param modelId Id of the associated model. - * @param resourceType Resource Type. - * @param resourceId Id of the associated resource. - * @param insightId Insight id. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of cascade delete job along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createCascadeDeleteJobWithResponseAsync(String jobId, String partyId, - String modelId, String resourceType, String resourceId, String insightId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.createCascadeDeleteJob(this.client.getEndpoint(), jobId, partyId, modelId, resourceType, - resourceId, insightId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Create a cascade delete job for insights specified partyId/modelId/resourceType/resourceId. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param modelId Id of the associated model. - * @param resourceType Resource Type. - * @param resourceId Id of the associated resource. - * @param insightId Insight id. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJobAsync(String jobId, String partyId, - String modelId, String resourceType, String resourceId, String insightId, RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createCascadeDeleteJobWithResponseAsync(jobId, partyId, modelId, resourceType, resourceId, - insightId, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Create a cascade delete job for insights specified partyId/modelId/resourceType/resourceId. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param modelId Id of the associated model. - * @param resourceType Resource Type. - * @param resourceId Id of the associated resource. - * @param insightId Insight id. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, String modelId, - String resourceType, String resourceId, String insightId, RequestOptions requestOptions) { - return this - .beginCreateCascadeDeleteJobAsync(jobId, partyId, modelId, resourceType, resourceId, insightId, - requestOptions) - .getSyncPoller(); - } - - /** - * Get a cascade delete job for specified insight. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified insight along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponseAsync(String jobId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getCascadeDeleteJobDetails(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get a cascade delete job for specified insight. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified insight along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions).block(); - } - - /** - * Returns a paginated list of insight resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minInsightStartDateTimeOffsetDateTimeNoMinimum insightStartDateTime time of insight resources (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
maxInsightStartDateTimeOffsetDateTimeNoMaximum insightStartDateTime time of insight resources (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
minInsightEndDateTimeOffsetDateTimeNoMinimum insightEndDateTime time of insight resources (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
maxInsightEndDateTimeOffsetDateTimeNoMaximum insightEndDateTime time of insight resources (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
measurementFiltersList<String>NoFilters on measureKey.unit/unitValue or measureKey.value/value pairs within the Measures object. - * eg. "measureKey.unit eq {testValue}" where testValue is string. - * eg. "measureKey.value eq {testValue}" where testValue = double. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     modelVersion: String (Optional)
-     *     attachmentsLink: String (Optional)
-     *     insightStartDateTime: OffsetDateTime (Optional)
-     *     insightEndDateTime: OffsetDateTime (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdModelIdAndResourceSinglePageAsync(String partyId, - String modelId, String resourceType, String resourceId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByPartyIdModelIdAndResource(this.client.getEndpoint(), partyId, modelId, - resourceType, resourceId, this.client.getServiceVersion().getVersion(), accept, requestOptions, - context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of insight resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minInsightStartDateTimeOffsetDateTimeNoMinimum insightStartDateTime time of insight resources (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
maxInsightStartDateTimeOffsetDateTimeNoMaximum insightStartDateTime time of insight resources (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
minInsightEndDateTimeOffsetDateTimeNoMinimum insightEndDateTime time of insight resources (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
maxInsightEndDateTimeOffsetDateTimeNoMaximum insightEndDateTime time of insight resources (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
measurementFiltersList<String>NoFilters on measureKey.unit/unitValue or measureKey.value/value pairs within the Measures object. - * eg. "measureKey.unit eq {testValue}" where testValue is string. - * eg. "measureKey.value eq {testValue}" where testValue = double. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     modelVersion: String (Optional)
-     *     attachmentsLink: String (Optional)
-     *     insightStartDateTime: OffsetDateTime (Optional)
-     *     insightEndDateTime: OffsetDateTime (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyIdModelIdAndResourceAsync(String partyId, String modelId, - String resourceType, String resourceId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>( - () -> listByPartyIdModelIdAndResourceSinglePageAsync(partyId, modelId, resourceType, resourceId, - requestOptions), - nextLink -> listByPartyIdModelIdAndResourceNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of insight resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minInsightStartDateTimeOffsetDateTimeNoMinimum insightStartDateTime time of insight resources (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
maxInsightStartDateTimeOffsetDateTimeNoMaximum insightStartDateTime time of insight resources (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
minInsightEndDateTimeOffsetDateTimeNoMinimum insightEndDateTime time of insight resources (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
maxInsightEndDateTimeOffsetDateTimeNoMaximum insightEndDateTime time of insight resources (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
measurementFiltersList<String>NoFilters on measureKey.unit/unitValue or measureKey.value/value pairs within the Measures object. - * eg. "measureKey.unit eq {testValue}" where testValue is string. - * eg. "measureKey.value eq {testValue}" where testValue = double. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     modelVersion: String (Optional)
-     *     attachmentsLink: String (Optional)
-     *     insightStartDateTime: OffsetDateTime (Optional)
-     *     insightEndDateTime: OffsetDateTime (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyIdModelIdAndResource(String partyId, String modelId, - String resourceType, String resourceId, RequestOptions requestOptions) { - return new PagedIterable<>( - listByPartyIdModelIdAndResourceAsync(partyId, modelId, resourceType, resourceId, requestOptions)); - } - - /** - * Creates or updates insight entity. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     modelVersion: String (Optional)
-     *     attachmentsLink: String (Optional)
-     *     insightStartDateTime: OffsetDateTime (Optional)
-     *     insightEndDateTime: OffsetDateTime (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     modelVersion: String (Optional)
-     *     attachmentsLink: String (Optional)
-     *     insightStartDateTime: OffsetDateTime (Optional)
-     *     insightEndDateTime: OffsetDateTime (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightId Id of the insight resource. - * @param insightData Insight data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of insight resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String partyId, String modelId, - String resourceType, String resourceId, String insightId, BinaryData insightData, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.createOrUpdate(this.client.getEndpoint(), partyId, modelId, resourceType, resourceId, - insightId, this.client.getServiceVersion().getVersion(), insightData, accept, requestOptions, context)); - } - - /** - * Creates or updates insight entity. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     modelVersion: String (Optional)
-     *     attachmentsLink: String (Optional)
-     *     insightStartDateTime: OffsetDateTime (Optional)
-     *     insightEndDateTime: OffsetDateTime (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     modelVersion: String (Optional)
-     *     attachmentsLink: String (Optional)
-     *     insightStartDateTime: OffsetDateTime (Optional)
-     *     insightEndDateTime: OffsetDateTime (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightId Id of the insight resource. - * @param insightData Insight data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of insight resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String modelId, String resourceType, - String resourceId, String insightId, BinaryData insightData, RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(partyId, modelId, resourceType, resourceId, insightId, insightData, - requestOptions).block(); - } - - /** - * Gets a specified insight resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     modelVersion: String (Optional)
-     *     attachmentsLink: String (Optional)
-     *     insightStartDateTime: OffsetDateTime (Optional)
-     *     insightEndDateTime: OffsetDateTime (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightId Id of the insight resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified insight resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String partyId, String modelId, String resourceType, - String resourceId, String insightId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), partyId, modelId, resourceType, - resourceId, insightId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Gets a specified insight resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     modelVersion: String (Optional)
-     *     attachmentsLink: String (Optional)
-     *     insightStartDateTime: OffsetDateTime (Optional)
-     *     insightEndDateTime: OffsetDateTime (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightId Id of the insight resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified insight resource under a particular party along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String modelId, String resourceType, String resourceId, - String insightId, RequestOptions requestOptions) { - return getWithResponseAsync(partyId, modelId, resourceType, resourceId, insightId, requestOptions).block(); - } - - /** - * Deletes a specified insight resource. - * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightId Id of the insight resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String partyId, String modelId, String resourceType, - String resourceId, String insightId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), partyId, modelId, resourceType, - resourceId, insightId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a specified insight resource. - * - * @param partyId Id of the associated party. - * @param modelId Id of the associated model. It can be either 'BiomassModelId', 'SensorPlacementModelId', - * 'SoilMoistureModelId' or any solution id. - * @param resourceType Resource type associated with the record. - * @param resourceId Id of the associated resource. - * @param insightId Id of the insight resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String modelId, String resourceType, String resourceId, - String insightId, RequestOptions requestOptions) { - return deleteWithResponseAsync(partyId, modelId, resourceType, resourceId, insightId, requestOptions).block(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     modelId: String (Optional)
-     *     resourceType: String(Party/Farm/Field/SeasonalField/Boundary) (Optional)
-     *     resourceId: String (Optional)
-     *     modelVersion: String (Optional)
-     *     attachmentsLink: String (Optional)
-     *     insightStartDateTime: OffsetDateTime (Optional)
-     *     insightEndDateTime: OffsetDateTime (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdModelIdAndResourceNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByPartyIdModelIdAndResourceNext(nextLink, this.client.getEndpoint(), - accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/ManagementZonesImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/ManagementZonesImpl.java deleted file mode 100644 index 355267f29cd3..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/ManagementZonesImpl.java +++ /dev/null @@ -1,1168 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.DefaultPollingStrategy; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.core.util.serializer.TypeReference; -import java.time.Duration; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ManagementZones. */ -public final class ManagementZonesImpl { - /** The proxy service used to perform REST calls. */ - private final ManagementZonesService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of ManagementZonesImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ManagementZonesImpl(FarmBeatsClientImpl client) { - this.service - = RestProxy.create(ManagementZonesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientManagementZones to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientManag") - public interface ManagementZonesService { - @Get("/management-zones") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/management-zones/cascade-delete/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getCascadeDeleteJobDetails(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Put("/management-zones/cascade-delete/{jobId}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createCascadeDeleteJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("partyId") String partyId, - @QueryParam("managementZoneId") String managementZoneId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/management-zones") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyId(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/management-zones/{managementZoneId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("managementZoneId") String managementZoneId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Patch("/parties/{partyId}/management-zones/{managementZoneId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @PathParam("managementZoneId") String managementZoneId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData managementZone, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/parties/{partyId}/management-zones/{managementZoneId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("managementZoneId") String managementZoneId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyIdNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of management zone resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCropIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeasonIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoFieldIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of management zone resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCropIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeasonIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoFieldIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of management zone resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCropIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeasonIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoFieldIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(requestOptions)); - } - - /** - * Get a cascade delete job for specified job id. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified job id along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponseAsync(String jobId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getCascadeDeleteJobDetails(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get a cascade delete job for specified job id. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified job id along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions).block(); - } - - /** - * Create a cascade delete job for specified management zone. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param managementZoneId ID of the management zone to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of cascade delete job along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createCascadeDeleteJobWithResponseAsync(String jobId, String partyId, - String managementZoneId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createCascadeDeleteJob(this.client.getEndpoint(), jobId, partyId, - managementZoneId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Create a cascade delete job for specified management zone. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param managementZoneId ID of the management zone to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJobAsync(String jobId, String partyId, - String managementZoneId, RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createCascadeDeleteJobWithResponseAsync(jobId, partyId, managementZoneId, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Create a cascade delete job for specified management zone. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param managementZoneId ID of the management zone to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, - String managementZoneId, RequestOptions requestOptions) { - return this.beginCreateCascadeDeleteJobAsync(jobId, partyId, managementZoneId, requestOptions).getSyncPoller(); - } - - /** - * Returns a paginated list of management zone resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCropIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeasonIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoFieldIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdSinglePageAsync(String partyId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByPartyId(this.client.getEndpoint(), partyId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of management zone resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCropIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeasonIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoFieldIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyIdAsync(String partyId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listByPartyIdSinglePageAsync(partyId, requestOptions), - nextLink -> listByPartyIdNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of management zone resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCropIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeasonIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoFieldIds of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources of the ManagementZone. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(listByPartyIdAsync(partyId, requestOptions)); - } - - /** - * Gets a specified management zone resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param managementZoneId Id of the management zone. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified management zone resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String partyId, String managementZoneId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), partyId, managementZoneId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Gets a specified management zone resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param managementZoneId Id of the management zone. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified management zone resource under a particular party along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String managementZoneId, - RequestOptions requestOptions) { - return getWithResponseAsync(partyId, managementZoneId, requestOptions).block(); - } - - /** - * Creates or updates a management zone resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party resource. - * @param managementZoneId Id of the management zone resource. - * @param managementZone ManagementZone resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return api Model for ManagementZone object along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String partyId, String managementZoneId, - BinaryData managementZone, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), partyId, managementZoneId, - this.client.getServiceVersion().getVersion(), managementZone, accept, requestOptions, context)); - } - - /** - * Creates or updates a management zone resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party resource. - * @param managementZoneId Id of the management zone resource. - * @param managementZone ManagementZone resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return api Model for ManagementZone object along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String managementZoneId, - BinaryData managementZone, RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(partyId, managementZoneId, managementZone, requestOptions).block(); - } - - /** - * Deletes a specified management zone resource under a particular party. - * - * @param partyId Id of the party. - * @param managementZoneId Id of the management zone. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String partyId, String managementZoneId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), partyId, managementZoneId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a specified management zone resource under a particular party. - * - * @param partyId Id of the party. - * @param managementZoneId Id of the management zone. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String managementZoneId, RequestOptions requestOptions) { - return deleteWithResponseAsync(partyId, managementZoneId, requestOptions).block(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listByPartyIdNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/ModelInferencesImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/ModelInferencesImpl.java deleted file mode 100644 index a04e4bfd8991..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/ModelInferencesImpl.java +++ /dev/null @@ -1,1261 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.DefaultPollingStrategy; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.core.util.serializer.TypeReference; -import java.time.Duration; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ModelInferences. */ -public final class ModelInferencesImpl { - /** The proxy service used to perform REST calls. */ - private final ModelInferencesService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of ModelInferencesImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ModelInferencesImpl(FarmBeatsClientImpl client) { - this.service - = RestProxy.create(ModelInferencesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientModelInferences to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientModel") - public interface ModelInferencesService { - @Put("/model-inference/models/microsoft-biomass/infer-data/{jobId}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createBiomassModelJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BinaryData job, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/model-inference/models/microsoft-biomass/infer-data/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getBiomassModelJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Put("/model-inference/models/microsoft-sensor-placement/infer-data/{jobId}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createSensorPlacementModelJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BinaryData job, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/model-inference/models/microsoft-sensor-placement/infer-data/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getSensorPlacementModelJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Put("/model-inference/models/microsoft-soil-moisture/infer-data/{jobId}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createSoilMoistureModelJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BinaryData job, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/model-inference/models/microsoft-soil-moisture/infer-data/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getSoilMoistureModelJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - } - - /** - * Create a Biomass Model job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     cropName: String(Corn) (Required)
-     *     plantingStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     weatherExtensionId: String (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     cropName: String(Corn) (Required)
-     *     plantingStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     weatherExtensionId: String (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId JobId provided by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of biomass model job along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createBiomassModelJobWithResponseAsync(String jobId, BinaryData job, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createBiomassModelJob(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), job, accept, requestOptions, context)); - } - - /** - * Create a Biomass Model job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     cropName: String(Corn) (Required)
-     *     plantingStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     weatherExtensionId: String (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     cropName: String(Corn) (Required)
-     *     plantingStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     weatherExtensionId: String (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId JobId provided by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of biomass model job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateBiomassModelJobAsync(String jobId, BinaryData job, - RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createBiomassModelJobWithResponseAsync(jobId, job, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Create a Biomass Model job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     cropName: String(Corn) (Required)
-     *     plantingStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     weatherExtensionId: String (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     cropName: String(Corn) (Required)
-     *     plantingStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     weatherExtensionId: String (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId JobId provided by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of biomass model job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateBiomassModelJob(String jobId, BinaryData job, - RequestOptions requestOptions) { - return this.beginCreateBiomassModelJobAsync(jobId, job, requestOptions).getSyncPoller(); - } - - /** - * Get Biomass Model job's details. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     cropName: String(Corn) (Required)
-     *     plantingStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     weatherExtensionId: String (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return biomass Model job's details along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getBiomassModelJobWithResponseAsync(String jobId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getBiomassModelJob(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get Biomass Model job's details. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     cropName: String(Corn) (Required)
-     *     plantingStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     weatherExtensionId: String (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return biomass Model job's details along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getBiomassModelJobWithResponse(String jobId, RequestOptions requestOptions) { - return getBiomassModelJobWithResponseAsync(jobId, requestOptions).block(); - } - - /** - * Create a Sensor Placement Model job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     sensorType: String (Required)
-     *     isRanked: boolean (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     sensorType: String (Required)
-     *     isRanked: boolean (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId JobId provided by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of sensor placement model job along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createSensorPlacementModelJobWithResponseAsync(String jobId, BinaryData job, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createSensorPlacementModelJob(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), job, accept, requestOptions, context)); - } - - /** - * Create a Sensor Placement Model job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     sensorType: String (Required)
-     *     isRanked: boolean (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     sensorType: String (Required)
-     *     isRanked: boolean (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId JobId provided by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of sensor placement model job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateSensorPlacementModelJobAsync(String jobId, BinaryData job, - RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createSensorPlacementModelJobWithResponseAsync(jobId, job, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Create a Sensor Placement Model job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     sensorType: String (Required)
-     *     isRanked: boolean (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     sensorType: String (Required)
-     *     isRanked: boolean (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId JobId provided by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of sensor placement model job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateSensorPlacementModelJob(String jobId, BinaryData job, - RequestOptions requestOptions) { - return this.beginCreateSensorPlacementModelJobAsync(jobId, job, requestOptions).getSyncPoller(); - } - - /** - * Get Sensor Placement Model job's details. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     sensorType: String (Required)
-     *     isRanked: boolean (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensor Placement Model job's details along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSensorPlacementModelJobWithResponseAsync(String jobId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getSensorPlacementModelJob(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get Sensor Placement Model job's details. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     modelVersion: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     sensorType: String (Required)
-     *     isRanked: boolean (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensor Placement Model job's details along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSensorPlacementModelJobWithResponse(String jobId, RequestOptions requestOptions) { - return getSensorPlacementModelJobWithResponseAsync(jobId, requestOptions).block(); - } - - /** - * Create a SoilMoisture Model job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     sensorDataModelId: String (Required)
-     *     sensorPartnerId: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     modelVersion: String (Required)
-     *     sensorDefinition (Required): {
-     *         sensorMeasurement: String (Required)
-     *         minProperty: String (Required)
-     *         maxProperty: String (Required)
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     sensorDataModelId: String (Required)
-     *     sensorPartnerId: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     modelVersion: String (Required)
-     *     sensorDefinition (Required): {
-     *         sensorMeasurement: String (Required)
-     *         minProperty: String (Required)
-     *         maxProperty: String (Required)
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId JobId provided by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of soil moisture model job along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createSoilMoistureModelJobWithResponseAsync(String jobId, BinaryData job, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createSoilMoistureModelJob(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), job, accept, requestOptions, context)); - } - - /** - * Create a SoilMoisture Model job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     sensorDataModelId: String (Required)
-     *     sensorPartnerId: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     modelVersion: String (Required)
-     *     sensorDefinition (Required): {
-     *         sensorMeasurement: String (Required)
-     *         minProperty: String (Required)
-     *         maxProperty: String (Required)
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     sensorDataModelId: String (Required)
-     *     sensorPartnerId: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     modelVersion: String (Required)
-     *     sensorDefinition (Required): {
-     *         sensorMeasurement: String (Required)
-     *         minProperty: String (Required)
-     *         maxProperty: String (Required)
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId JobId provided by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of soil moisture model job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateSoilMoistureModelJobAsync(String jobId, BinaryData job, - RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createSoilMoistureModelJobWithResponseAsync(jobId, job, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Create a SoilMoisture Model job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     sensorDataModelId: String (Required)
-     *     sensorPartnerId: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     modelVersion: String (Required)
-     *     sensorDefinition (Required): {
-     *         sensorMeasurement: String (Required)
-     *         minProperty: String (Required)
-     *         maxProperty: String (Required)
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     sensorDataModelId: String (Required)
-     *     sensorPartnerId: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     modelVersion: String (Required)
-     *     sensorDefinition (Required): {
-     *         sensorMeasurement: String (Required)
-     *         minProperty: String (Required)
-     *         maxProperty: String (Required)
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId JobId provided by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of soil moisture model job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateSoilMoistureModelJob(String jobId, BinaryData job, - RequestOptions requestOptions) { - return this.beginCreateSoilMoistureModelJobAsync(jobId, job, requestOptions).getSyncPoller(); - } - - /** - * Get SoilMoisture Model job's details. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     sensorDataModelId: String (Required)
-     *     sensorPartnerId: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     modelVersion: String (Required)
-     *     sensorDefinition (Required): {
-     *         sensorMeasurement: String (Required)
-     *         minProperty: String (Required)
-     *         maxProperty: String (Required)
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return soilMoisture Model job's details along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSoilMoistureModelJobWithResponseAsync(String jobId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getSoilMoistureModelJob(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get SoilMoisture Model job's details. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     sensorDataModelId: String (Required)
-     *     sensorPartnerId: String (Required)
-     *     inferenceStartDateTime: OffsetDateTime (Required)
-     *     inferenceEndDateTime: OffsetDateTime (Required)
-     *     satelliteProvider: String(Microsoft) (Required)
-     *     satelliteSource: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     imageResolution: double (Required)
-     *     imageFormat: String(TIF) (Required)
-     *     modelVersion: String (Required)
-     *     sensorDefinition (Required): {
-     *         sensorMeasurement: String (Required)
-     *         minProperty: String (Required)
-     *         maxProperty: String (Required)
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return soilMoisture Model job's details along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSoilMoistureModelJobWithResponse(String jobId, RequestOptions requestOptions) { - return getSoilMoistureModelJobWithResponseAsync(jobId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/NutrientAnalysesImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/NutrientAnalysesImpl.java deleted file mode 100644 index 06e80464dcab..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/NutrientAnalysesImpl.java +++ /dev/null @@ -1,1093 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in NutrientAnalyses. */ -public final class NutrientAnalysesImpl { - /** The proxy service used to perform REST calls. */ - private final NutrientAnalysesService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of NutrientAnalysesImpl. - * - * @param client the instance of the service client containing this operation class. - */ - NutrientAnalysesImpl(FarmBeatsClientImpl client) { - this.service - = RestProxy.create(NutrientAnalysesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientNutrientAnalyses to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientNutri") - public interface NutrientAnalysesService { - @Get("/nutrient-analyses") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/nutrient-analyses") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyId(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/nutrient-analyses/{nutrientAnalysisId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("nutrientAnalysisId") String nutrientAnalysisId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Patch("/parties/{partyId}/nutrient-analyses/{nutrientAnalysisId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @PathParam("nutrientAnalysisId") String nutrientAnalysisId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData nutrientAnalysis, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Delete("/parties/{partyId}/nutrient-analyses/{nutrientAnalysisId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("nutrientAnalysisId") String nutrientAnalysisId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyIdNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of nutrient analysis resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
parentTypeStringNoType of the parent it belongs to. - * i.e. PlantTissueAnalysis.
parentIdsList<String>NoParent ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
classificationsList<String>NoClassifications for nutrient analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     parentType: String(PlantTissueAnalysis) (Optional)
-     *     unit: String (Optional)
-     *     value: Double (Optional)
-     *     referenceValueLow: Double (Optional)
-     *     referenceValueHigh: Double (Optional)
-     *     classification: String (Optional)
-     *     recommendation: String (Optional)
-     *     products (Optional): [
-     *          (Optional){
-     *             rate: String (Optional)
-     *             instruction: String (Optional)
-     *             product: String (Optional)
-     *         }
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of nutrient analysis resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
parentTypeStringNoType of the parent it belongs to. - * i.e. PlantTissueAnalysis.
parentIdsList<String>NoParent ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
classificationsList<String>NoClassifications for nutrient analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     parentType: String(PlantTissueAnalysis) (Optional)
-     *     unit: String (Optional)
-     *     value: Double (Optional)
-     *     referenceValueLow: Double (Optional)
-     *     referenceValueHigh: Double (Optional)
-     *     classification: String (Optional)
-     *     recommendation: String (Optional)
-     *     products (Optional): [
-     *          (Optional){
-     *             rate: String (Optional)
-     *             instruction: String (Optional)
-     *             product: String (Optional)
-     *         }
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of nutrient analysis resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
parentTypeStringNoType of the parent it belongs to. - * i.e. PlantTissueAnalysis.
parentIdsList<String>NoParent ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
classificationsList<String>NoClassifications for nutrient analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     parentType: String(PlantTissueAnalysis) (Optional)
-     *     unit: String (Optional)
-     *     value: Double (Optional)
-     *     referenceValueLow: Double (Optional)
-     *     referenceValueHigh: Double (Optional)
-     *     classification: String (Optional)
-     *     recommendation: String (Optional)
-     *     products (Optional): [
-     *          (Optional){
-     *             rate: String (Optional)
-     *             instruction: String (Optional)
-     *             product: String (Optional)
-     *         }
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(requestOptions)); - } - - /** - * Returns a paginated list of nutrient analysis resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
parentTypeStringNoType of the parent it belongs to. - * i.e. PlantTissueAnalysis.
parentIdsList<String>NoParent ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
classificationsList<String>NoClassifications for nutrient analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     parentType: String(PlantTissueAnalysis) (Optional)
-     *     unit: String (Optional)
-     *     value: Double (Optional)
-     *     referenceValueLow: Double (Optional)
-     *     referenceValueHigh: Double (Optional)
-     *     classification: String (Optional)
-     *     recommendation: String (Optional)
-     *     products (Optional): [
-     *          (Optional){
-     *             rate: String (Optional)
-     *             instruction: String (Optional)
-     *             product: String (Optional)
-     *         }
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdSinglePageAsync(String partyId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByPartyId(this.client.getEndpoint(), partyId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of nutrient analysis resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
parentTypeStringNoType of the parent it belongs to. - * i.e. PlantTissueAnalysis.
parentIdsList<String>NoParent ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
classificationsList<String>NoClassifications for nutrient analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     parentType: String(PlantTissueAnalysis) (Optional)
-     *     unit: String (Optional)
-     *     value: Double (Optional)
-     *     referenceValueLow: Double (Optional)
-     *     referenceValueHigh: Double (Optional)
-     *     classification: String (Optional)
-     *     recommendation: String (Optional)
-     *     products (Optional): [
-     *          (Optional){
-     *             rate: String (Optional)
-     *             instruction: String (Optional)
-     *             product: String (Optional)
-     *         }
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyIdAsync(String partyId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listByPartyIdSinglePageAsync(partyId, requestOptions), - nextLink -> listByPartyIdNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of nutrient analysis resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
parentTypeStringNoType of the parent it belongs to. - * i.e. PlantTissueAnalysis.
parentIdsList<String>NoParent ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
classificationsList<String>NoClassifications for nutrient analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     parentType: String(PlantTissueAnalysis) (Optional)
-     *     unit: String (Optional)
-     *     value: Double (Optional)
-     *     referenceValueLow: Double (Optional)
-     *     referenceValueHigh: Double (Optional)
-     *     classification: String (Optional)
-     *     recommendation: String (Optional)
-     *     products (Optional): [
-     *          (Optional){
-     *             rate: String (Optional)
-     *             instruction: String (Optional)
-     *             product: String (Optional)
-     *         }
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(listByPartyIdAsync(partyId, requestOptions)); - } - - /** - * Gets a specified nutrient analysis resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     parentType: String(PlantTissueAnalysis) (Optional)
-     *     unit: String (Optional)
-     *     value: Double (Optional)
-     *     referenceValueLow: Double (Optional)
-     *     referenceValueHigh: Double (Optional)
-     *     classification: String (Optional)
-     *     recommendation: String (Optional)
-     *     products (Optional): [
-     *          (Optional){
-     *             rate: String (Optional)
-     *             instruction: String (Optional)
-     *             product: String (Optional)
-     *         }
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param nutrientAnalysisId Id of the nutrient analysis. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified nutrient analysis resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String partyId, String nutrientAnalysisId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), partyId, nutrientAnalysisId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Gets a specified nutrient analysis resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     parentType: String(PlantTissueAnalysis) (Optional)
-     *     unit: String (Optional)
-     *     value: Double (Optional)
-     *     referenceValueLow: Double (Optional)
-     *     referenceValueHigh: Double (Optional)
-     *     classification: String (Optional)
-     *     recommendation: String (Optional)
-     *     products (Optional): [
-     *          (Optional){
-     *             rate: String (Optional)
-     *             instruction: String (Optional)
-     *             product: String (Optional)
-     *         }
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param nutrientAnalysisId Id of the nutrient analysis. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified nutrient analysis resource under a particular party along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String nutrientAnalysisId, - RequestOptions requestOptions) { - return getWithResponseAsync(partyId, nutrientAnalysisId, requestOptions).block(); - } - - /** - * Creates or updates a nutrient analysis resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     parentType: String(PlantTissueAnalysis) (Optional)
-     *     unit: String (Optional)
-     *     value: Double (Optional)
-     *     referenceValueLow: Double (Optional)
-     *     referenceValueHigh: Double (Optional)
-     *     classification: String (Optional)
-     *     recommendation: String (Optional)
-     *     products (Optional): [
-     *          (Optional){
-     *             rate: String (Optional)
-     *             instruction: String (Optional)
-     *             product: String (Optional)
-     *         }
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     parentType: String(PlantTissueAnalysis) (Optional)
-     *     unit: String (Optional)
-     *     value: Double (Optional)
-     *     referenceValueLow: Double (Optional)
-     *     referenceValueHigh: Double (Optional)
-     *     classification: String (Optional)
-     *     recommendation: String (Optional)
-     *     products (Optional): [
-     *          (Optional){
-     *             rate: String (Optional)
-     *             instruction: String (Optional)
-     *             product: String (Optional)
-     *         }
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party resource. - * @param nutrientAnalysisId Id of the nutrient analysis resource. - * @param nutrientAnalysis NutrientAnalysis resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return api Model for nutrient analysis object along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String partyId, String nutrientAnalysisId, - BinaryData nutrientAnalysis, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), partyId, nutrientAnalysisId, - this.client.getServiceVersion().getVersion(), nutrientAnalysis, accept, requestOptions, context)); - } - - /** - * Creates or updates a nutrient analysis resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     parentType: String(PlantTissueAnalysis) (Optional)
-     *     unit: String (Optional)
-     *     value: Double (Optional)
-     *     referenceValueLow: Double (Optional)
-     *     referenceValueHigh: Double (Optional)
-     *     classification: String (Optional)
-     *     recommendation: String (Optional)
-     *     products (Optional): [
-     *          (Optional){
-     *             rate: String (Optional)
-     *             instruction: String (Optional)
-     *             product: String (Optional)
-     *         }
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     parentType: String(PlantTissueAnalysis) (Optional)
-     *     unit: String (Optional)
-     *     value: Double (Optional)
-     *     referenceValueLow: Double (Optional)
-     *     referenceValueHigh: Double (Optional)
-     *     classification: String (Optional)
-     *     recommendation: String (Optional)
-     *     products (Optional): [
-     *          (Optional){
-     *             rate: String (Optional)
-     *             instruction: String (Optional)
-     *             product: String (Optional)
-     *         }
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party resource. - * @param nutrientAnalysisId Id of the nutrient analysis resource. - * @param nutrientAnalysis NutrientAnalysis resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return api Model for nutrient analysis object along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String nutrientAnalysisId, - BinaryData nutrientAnalysis, RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(partyId, nutrientAnalysisId, nutrientAnalysis, requestOptions).block(); - } - - /** - * Deletes a specified nutrient analysis resource under a particular party. - * - * @param partyId Id of the party. - * @param nutrientAnalysisId Id of the nutrient analysis. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String partyId, String nutrientAnalysisId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), partyId, nutrientAnalysisId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a specified nutrient analysis resource under a particular party. - * - * @param partyId Id of the party. - * @param nutrientAnalysisId Id of the nutrient analysis. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String nutrientAnalysisId, RequestOptions requestOptions) { - return deleteWithResponseAsync(partyId, nutrientAnalysisId, requestOptions).block(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     parentType: String(PlantTissueAnalysis) (Optional)
-     *     unit: String (Optional)
-     *     value: Double (Optional)
-     *     referenceValueLow: Double (Optional)
-     *     referenceValueHigh: Double (Optional)
-     *     classification: String (Optional)
-     *     recommendation: String (Optional)
-     *     products (Optional): [
-     *          (Optional){
-     *             rate: String (Optional)
-     *             instruction: String (Optional)
-     *             product: String (Optional)
-     *         }
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     parentId: String (Optional)
-     *     parentType: String(PlantTissueAnalysis) (Optional)
-     *     unit: String (Optional)
-     *     value: Double (Optional)
-     *     referenceValueLow: Double (Optional)
-     *     referenceValueHigh: Double (Optional)
-     *     classification: String (Optional)
-     *     recommendation: String (Optional)
-     *     products (Optional): [
-     *          (Optional){
-     *             rate: String (Optional)
-     *             instruction: String (Optional)
-     *             product: String (Optional)
-     *         }
-     *     ]
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listByPartyIdNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/OAuthProvidersImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/OAuthProvidersImpl.java deleted file mode 100644 index 97cf51b46769..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/OAuthProvidersImpl.java +++ /dev/null @@ -1,852 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.DefaultPollingStrategy; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.core.util.serializer.TypeReference; -import java.time.Duration; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OAuthProviders. */ -public final class OAuthProvidersImpl { - /** The proxy service used to perform REST calls. */ - private final OAuthProvidersService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of OAuthProvidersImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OAuthProvidersImpl(FarmBeatsClientImpl client) { - this.service - = RestProxy.create(OAuthProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientOAuthProviders to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientOAuth") - public interface OAuthProvidersService { - @Get("/oauth/providers") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/oauth/providers/{oauthProviderId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @PathParam("oauthProviderId") String oauthProviderId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Patch("/oauth/providers/{oauthProviderId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("oauthProviderId") String oauthProviderId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData oauthProvider, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/oauth/providers/{oauthProviderId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @PathParam("oauthProviderId") String oauthProviderId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/oauth/providers/cascade-delete/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getCascadeDeleteJobDetails(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Put("/oauth/providers/cascade-delete/{jobId}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createCascadeDeleteJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("oauthProviderId") String oauthProviderId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of oauthProvider resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     appId: String (Optional)
-     *     appSecret: String (Optional)
-     *     apiKey: String (Optional)
-     *     isProductionApp: Boolean (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of oauthProvider resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     appId: String (Optional)
-     *     appSecret: String (Optional)
-     *     apiKey: String (Optional)
-     *     isProductionApp: Boolean (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of oauthProvider resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     appId: String (Optional)
-     *     appSecret: String (Optional)
-     *     apiKey: String (Optional)
-     *     isProductionApp: Boolean (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(requestOptions)); - } - - /** - * Get a specified oauthProvider resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     appId: String (Optional)
-     *     appSecret: String (Optional)
-     *     apiKey: String (Optional)
-     *     isProductionApp: Boolean (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param oauthProviderId ID of the oauthProvider resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified oauthProvider resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String oauthProviderId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), oauthProviderId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get a specified oauthProvider resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     appId: String (Optional)
-     *     appSecret: String (Optional)
-     *     apiKey: String (Optional)
-     *     isProductionApp: Boolean (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param oauthProviderId ID of the oauthProvider resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified oauthProvider resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String oauthProviderId, RequestOptions requestOptions) { - return getWithResponseAsync(oauthProviderId, requestOptions).block(); - } - - /** - * Creates or updates an oauthProvider resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     appId: String (Optional)
-     *     appSecret: String (Optional)
-     *     apiKey: String (Optional)
-     *     isProductionApp: Boolean (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     appId: String (Optional)
-     *     appSecret: String (Optional)
-     *     apiKey: String (Optional)
-     *     isProductionApp: Boolean (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param oauthProviderId ID of oauthProvider resource. - * @param oauthProvider OauthProvider resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of OAuth provider resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String oauthProviderId, BinaryData oauthProvider, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), oauthProviderId, - this.client.getServiceVersion().getVersion(), oauthProvider, accept, requestOptions, context)); - } - - /** - * Creates or updates an oauthProvider resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     appId: String (Optional)
-     *     appSecret: String (Optional)
-     *     apiKey: String (Optional)
-     *     isProductionApp: Boolean (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     appId: String (Optional)
-     *     appSecret: String (Optional)
-     *     apiKey: String (Optional)
-     *     isProductionApp: Boolean (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param oauthProviderId ID of oauthProvider resource. - * @param oauthProvider OauthProvider resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of OAuth provider resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String oauthProviderId, BinaryData oauthProvider, - RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(oauthProviderId, oauthProvider, requestOptions).block(); - } - - /** - * Deletes an specified oauthProvider resource. - * - * @param oauthProviderId ID of oauthProvider. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String oauthProviderId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), oauthProviderId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes an specified oauthProvider resource. - * - * @param oauthProviderId ID of oauthProvider. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String oauthProviderId, RequestOptions requestOptions) { - return deleteWithResponseAsync(oauthProviderId, requestOptions).block(); - } - - /** - * Get cascade delete job for oauthProvider resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     oauthProviderId: String (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for oauthProvider resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponseAsync(String jobId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getCascadeDeleteJobDetails(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get cascade delete job for oauthProvider resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     oauthProviderId: String (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for oauthProvider resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions).block(); - } - - /** - * Create cascade delete job for oauthProvider resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     oauthProviderId: String (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param oauthProviderId Id of the application data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of oauth provider cascade delete job along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createCascadeDeleteJobWithResponseAsync(String jobId, String oauthProviderId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createCascadeDeleteJob(this.client.getEndpoint(), jobId, - oauthProviderId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Create cascade delete job for oauthProvider resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     oauthProviderId: String (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param oauthProviderId Id of the application data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of oauth provider cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJobAsync(String jobId, String oauthProviderId, - RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createCascadeDeleteJobWithResponseAsync(jobId, oauthProviderId, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Create cascade delete job for oauthProvider resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     oauthProviderId: String (Required)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param oauthProviderId Id of the application data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of oauth provider cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String oauthProviderId, - RequestOptions requestOptions) { - return this.beginCreateCascadeDeleteJobAsync(jobId, oauthProviderId, requestOptions).getSyncPoller(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     appId: String (Optional)
-     *     appSecret: String (Optional)
-     *     apiKey: String (Optional)
-     *     isProductionApp: Boolean (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/OAuthTokensImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/OAuthTokensImpl.java deleted file mode 100644 index b8ad13734047..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/OAuthTokensImpl.java +++ /dev/null @@ -1,596 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.DefaultPollingStrategy; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.core.util.serializer.TypeReference; -import java.time.Duration; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OAuthTokens. */ -public final class OAuthTokensImpl { - /** The proxy service used to perform REST calls. */ - private final OAuthTokensService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of OAuthTokensImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OAuthTokensImpl(FarmBeatsClientImpl client) { - this.service - = RestProxy.create(OAuthTokensService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientOAuthTokens to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientOAuth") - public interface OAuthTokensService { - @Get("/oauth/tokens") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Post("/oauth/tokens/:connect") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getOAuthConnectionLink(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") BinaryData oauthConnectRequest, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/oauth/tokens/remove/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getCascadeDeleteJobDetails(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Put("/oauth/tokens/remove/{jobId}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createCascadeDeleteJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("partyId") String partyId, - @QueryParam("oauthProviderId") String oauthProviderId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a list of OAuthToken documents. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
authProviderIdsList<String>NoName of AuthProvider. Call {@link RequestOptions#addQueryParam} to add string to array.
partyIdsList<String>NoList of parties. Call {@link RequestOptions#addQueryParam} to add string to array.
isValidBooleanNoIf the token object is valid.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     authProviderId: String (Required)
-     *     isValid: Boolean (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a list of OAuthToken documents. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
authProviderIdsList<String>NoName of AuthProvider. Call {@link RequestOptions#addQueryParam} to add string to array.
partyIdsList<String>NoList of parties. Call {@link RequestOptions#addQueryParam} to add string to array.
isValidBooleanNoIf the token object is valid.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     authProviderId: String (Required)
-     *     isValid: Boolean (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a list of OAuthToken documents. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
authProviderIdsList<String>NoName of AuthProvider. Call {@link RequestOptions#addQueryParam} to add string to array.
partyIdsList<String>NoList of parties. Call {@link RequestOptions#addQueryParam} to add string to array.
isValidBooleanNoIf the token object is valid.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     authProviderId: String (Required)
-     *     isValid: Boolean (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(requestOptions)); - } - - /** - * Returns Connection link needed in the OAuth flow. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     oAuthProviderId: String (Required)
-     *     userRedirectLink: String (Required)
-     *     userRedirectState: String (Optional)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * String
-     * }
- * - * @param oauthConnectRequest OAuth Connect Request. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getOAuthConnectionLinkWithResponseAsync(BinaryData oauthConnectRequest, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getOAuthConnectionLink(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), oauthConnectRequest, accept, requestOptions, context)); - } - - /** - * Returns Connection link needed in the OAuth flow. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     oAuthProviderId: String (Required)
-     *     userRedirectLink: String (Required)
-     *     userRedirectState: String (Optional)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * String
-     * }
- * - * @param oauthConnectRequest OAuth Connect Request. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getOAuthConnectionLinkWithResponse(BinaryData oauthConnectRequest, - RequestOptions requestOptions) { - return getOAuthConnectionLinkWithResponseAsync(oauthConnectRequest, requestOptions).block(); - } - - /** - * Get remove job for OAuth token. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return remove job for OAuth token along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponseAsync(String jobId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getCascadeDeleteJobDetails(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get remove job for OAuth token. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return remove job for OAuth token along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions).block(); - } - - /** - * Create remove job for OAuth token. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param partyId Id of the party. - * @param oauthProviderId Id of the OAuthProvider. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of cascade delete job along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createCascadeDeleteJobWithResponseAsync(String jobId, String partyId, - String oauthProviderId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createCascadeDeleteJob(this.client.getEndpoint(), jobId, partyId, - oauthProviderId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Create remove job for OAuth token. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param partyId Id of the party. - * @param oauthProviderId Id of the OAuthProvider. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJobAsync(String jobId, String partyId, - String oauthProviderId, RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createCascadeDeleteJobWithResponseAsync(jobId, partyId, oauthProviderId, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Create remove job for OAuth token. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param partyId Id of the party. - * @param oauthProviderId Id of the OAuthProvider. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, - String oauthProviderId, RequestOptions requestOptions) { - return this.beginCreateCascadeDeleteJobAsync(jobId, partyId, oauthProviderId, requestOptions).getSyncPoller(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     authProviderId: String (Required)
-     *     isValid: Boolean (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/PartiesImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/PartiesImpl.java deleted file mode 100644 index f33d7365d255..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/PartiesImpl.java +++ /dev/null @@ -1,805 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.DefaultPollingStrategy; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.core.util.serializer.TypeReference; -import java.time.Duration; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in Parties. */ -public final class PartiesImpl { - /** The proxy service used to perform REST calls. */ - private final PartiesService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of PartiesImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PartiesImpl(FarmBeatsClientImpl client) { - this.service = RestProxy.create(PartiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientParties to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientParti") - public interface PartiesService { - @Get("/parties") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Patch("/parties/{partyId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData party, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/parties/{partyId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/parties/cascade-delete/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getCascadeDeleteJobDetails(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Put("/parties/cascade-delete/{jobId}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createCascadeDeleteJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("partyId") String partyId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of party resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of party resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of party resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(requestOptions)); - } - - /** - * Gets a specified party resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified party resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String partyId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), partyId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Gets a specified party resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified party resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, RequestOptions requestOptions) { - return getWithResponseAsync(partyId, requestOptions).block(); - } - - /** - * Creates or updates a party resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party resource. - * @param party Party resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of party resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String partyId, BinaryData party, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), partyId, - this.client.getServiceVersion().getVersion(), party, accept, requestOptions, context)); - } - - /** - * Creates or updates a party resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party resource. - * @param party Party resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of party resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, BinaryData party, - RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(partyId, party, requestOptions).block(); - } - - /** - * Deletes a specified party resource. - * - * @param partyId Id of party to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String partyId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), partyId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a specified party resource. - * - * @param partyId Id of party to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, RequestOptions requestOptions) { - return deleteWithResponseAsync(partyId, requestOptions).block(); - } - - /** - * Get a cascade delete job for specified party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified party along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponseAsync(String jobId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getCascadeDeleteJobDetails(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get a cascade delete job for specified party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified party along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions).block(); - } - - /** - * Create a cascade delete job for specified party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the party to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of cascade delete job along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createCascadeDeleteJobWithResponseAsync(String jobId, String partyId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createCascadeDeleteJob(this.client.getEndpoint(), jobId, partyId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Create a cascade delete job for specified party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the party to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJobAsync(String jobId, String partyId, - RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createCascadeDeleteJobWithResponseAsync(jobId, partyId, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Create a cascade delete job for specified party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the party to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, - RequestOptions requestOptions) { - return this.beginCreateCascadeDeleteJobAsync(jobId, partyId, requestOptions).getSyncPoller(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/PlantTissueAnalysesImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/PlantTissueAnalysesImpl.java deleted file mode 100644 index 3482555ae1f6..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/PlantTissueAnalysesImpl.java +++ /dev/null @@ -1,1393 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.DefaultPollingStrategy; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.core.util.serializer.TypeReference; -import java.time.Duration; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PlantTissueAnalyses. */ -public final class PlantTissueAnalysesImpl { - /** The proxy service used to perform REST calls. */ - private final PlantTissueAnalysesService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of PlantTissueAnalysesImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PlantTissueAnalysesImpl(FarmBeatsClientImpl client) { - this.service = RestProxy.create(PlantTissueAnalysesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientPlantTissueAnalyses to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientPlant") - public interface PlantTissueAnalysesService { - @Get("/parties/{partyId}/plant-tissue-analyses") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyId(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/plant-tissue-analyses/{plantTissueAnalysisId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("plantTissueAnalysisId") String plantTissueAnalysisId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Patch("/parties/{partyId}/plant-tissue-analyses/{plantTissueAnalysisId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @PathParam("plantTissueAnalysisId") String plantTissueAnalysisId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData plantTissueAnalysis, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Delete("/parties/{partyId}/plant-tissue-analyses/{plantTissueAnalysisId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("plantTissueAnalysisId") String plantTissueAnalysisId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/plant-tissue-analyses") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Put("/plant-tissue-analyses/cascade-delete/{jobId}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createCascadeDeleteJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("partyId") String partyId, - @QueryParam("plantTissueAnalysisId") String plantTissueAnalysisId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/plant-tissue-analyses/cascade-delete/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getCascadeDeleteJobDetails(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyIdNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of plant tissue analysis resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
seasonIdsList<String>NoSeason ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCrop ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
cropProductsIdsList<String>NoCrop products ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     fieldId: String (Optional)
-     *     cropId: String (Optional)
-     *     cropProductId: String (Optional)
-     *     seasonId: String (Optional)
-     *     plantingDateTime: OffsetDateTime (Optional)
-     *     growthStage: String (Optional)
-     *     plantPart: String (Optional)
-     *     plantPosition: String (Optional)
-     *     plantAppearance: String (Optional)
-     *     sampleCollectionCondition: String (Optional)
-     *     sampleCollectionDateTime: OffsetDateTime (Optional)
-     *     sampleReceivedDateTime: OffsetDateTime (Optional)
-     *     sampleTestResultDateTime: OffsetDateTime (Optional)
-     *     labDetails (Optional): {
-     *         code: String (Optional)
-     *         name: String (Optional)
-     *         description: String (Optional)
-     *         address: String (Optional)
-     *     }
-     *     attachmentsLink: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdSinglePageAsync(String partyId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByPartyId(this.client.getEndpoint(), partyId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of plant tissue analysis resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
seasonIdsList<String>NoSeason ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCrop ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
cropProductsIdsList<String>NoCrop products ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     fieldId: String (Optional)
-     *     cropId: String (Optional)
-     *     cropProductId: String (Optional)
-     *     seasonId: String (Optional)
-     *     plantingDateTime: OffsetDateTime (Optional)
-     *     growthStage: String (Optional)
-     *     plantPart: String (Optional)
-     *     plantPosition: String (Optional)
-     *     plantAppearance: String (Optional)
-     *     sampleCollectionCondition: String (Optional)
-     *     sampleCollectionDateTime: OffsetDateTime (Optional)
-     *     sampleReceivedDateTime: OffsetDateTime (Optional)
-     *     sampleTestResultDateTime: OffsetDateTime (Optional)
-     *     labDetails (Optional): {
-     *         code: String (Optional)
-     *         name: String (Optional)
-     *         description: String (Optional)
-     *         address: String (Optional)
-     *     }
-     *     attachmentsLink: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyIdAsync(String partyId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listByPartyIdSinglePageAsync(partyId, requestOptions), - nextLink -> listByPartyIdNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of plant tissue analysis resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
seasonIdsList<String>NoSeason ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCrop ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
cropProductsIdsList<String>NoCrop products ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     fieldId: String (Optional)
-     *     cropId: String (Optional)
-     *     cropProductId: String (Optional)
-     *     seasonId: String (Optional)
-     *     plantingDateTime: OffsetDateTime (Optional)
-     *     growthStage: String (Optional)
-     *     plantPart: String (Optional)
-     *     plantPosition: String (Optional)
-     *     plantAppearance: String (Optional)
-     *     sampleCollectionCondition: String (Optional)
-     *     sampleCollectionDateTime: OffsetDateTime (Optional)
-     *     sampleReceivedDateTime: OffsetDateTime (Optional)
-     *     sampleTestResultDateTime: OffsetDateTime (Optional)
-     *     labDetails (Optional): {
-     *         code: String (Optional)
-     *         name: String (Optional)
-     *         description: String (Optional)
-     *         address: String (Optional)
-     *     }
-     *     attachmentsLink: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(listByPartyIdAsync(partyId, requestOptions)); - } - - /** - * Gets a specified plant tissue analysis resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     fieldId: String (Optional)
-     *     cropId: String (Optional)
-     *     cropProductId: String (Optional)
-     *     seasonId: String (Optional)
-     *     plantingDateTime: OffsetDateTime (Optional)
-     *     growthStage: String (Optional)
-     *     plantPart: String (Optional)
-     *     plantPosition: String (Optional)
-     *     plantAppearance: String (Optional)
-     *     sampleCollectionCondition: String (Optional)
-     *     sampleCollectionDateTime: OffsetDateTime (Optional)
-     *     sampleReceivedDateTime: OffsetDateTime (Optional)
-     *     sampleTestResultDateTime: OffsetDateTime (Optional)
-     *     labDetails (Optional): {
-     *         code: String (Optional)
-     *         name: String (Optional)
-     *         description: String (Optional)
-     *         address: String (Optional)
-     *     }
-     *     attachmentsLink: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param plantTissueAnalysisId Id of the plant tissue analysis. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified plant tissue analysis resource under a particular party along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String partyId, String plantTissueAnalysisId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), partyId, plantTissueAnalysisId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Gets a specified plant tissue analysis resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     fieldId: String (Optional)
-     *     cropId: String (Optional)
-     *     cropProductId: String (Optional)
-     *     seasonId: String (Optional)
-     *     plantingDateTime: OffsetDateTime (Optional)
-     *     growthStage: String (Optional)
-     *     plantPart: String (Optional)
-     *     plantPosition: String (Optional)
-     *     plantAppearance: String (Optional)
-     *     sampleCollectionCondition: String (Optional)
-     *     sampleCollectionDateTime: OffsetDateTime (Optional)
-     *     sampleReceivedDateTime: OffsetDateTime (Optional)
-     *     sampleTestResultDateTime: OffsetDateTime (Optional)
-     *     labDetails (Optional): {
-     *         code: String (Optional)
-     *         name: String (Optional)
-     *         description: String (Optional)
-     *         address: String (Optional)
-     *     }
-     *     attachmentsLink: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param plantTissueAnalysisId Id of the plant tissue analysis. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified plant tissue analysis resource under a particular party along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String plantTissueAnalysisId, - RequestOptions requestOptions) { - return getWithResponseAsync(partyId, plantTissueAnalysisId, requestOptions).block(); - } - - /** - * Creates or updates a plant tissue analysis resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     fieldId: String (Optional)
-     *     cropId: String (Optional)
-     *     cropProductId: String (Optional)
-     *     seasonId: String (Optional)
-     *     plantingDateTime: OffsetDateTime (Optional)
-     *     growthStage: String (Optional)
-     *     plantPart: String (Optional)
-     *     plantPosition: String (Optional)
-     *     plantAppearance: String (Optional)
-     *     sampleCollectionCondition: String (Optional)
-     *     sampleCollectionDateTime: OffsetDateTime (Optional)
-     *     sampleReceivedDateTime: OffsetDateTime (Optional)
-     *     sampleTestResultDateTime: OffsetDateTime (Optional)
-     *     labDetails (Optional): {
-     *         code: String (Optional)
-     *         name: String (Optional)
-     *         description: String (Optional)
-     *         address: String (Optional)
-     *     }
-     *     attachmentsLink: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     fieldId: String (Optional)
-     *     cropId: String (Optional)
-     *     cropProductId: String (Optional)
-     *     seasonId: String (Optional)
-     *     plantingDateTime: OffsetDateTime (Optional)
-     *     growthStage: String (Optional)
-     *     plantPart: String (Optional)
-     *     plantPosition: String (Optional)
-     *     plantAppearance: String (Optional)
-     *     sampleCollectionCondition: String (Optional)
-     *     sampleCollectionDateTime: OffsetDateTime (Optional)
-     *     sampleReceivedDateTime: OffsetDateTime (Optional)
-     *     sampleTestResultDateTime: OffsetDateTime (Optional)
-     *     labDetails (Optional): {
-     *         code: String (Optional)
-     *         name: String (Optional)
-     *         description: String (Optional)
-     *         address: String (Optional)
-     *     }
-     *     attachmentsLink: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party resource. - * @param plantTissueAnalysisId Id of the plant tissue analysis resource. - * @param plantTissueAnalysis PlantTissueAnalysis resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return api Model for plant tissue analysis object along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String partyId, String plantTissueAnalysisId, - BinaryData plantTissueAnalysis, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), partyId, plantTissueAnalysisId, - this.client.getServiceVersion().getVersion(), plantTissueAnalysis, accept, requestOptions, context)); - } - - /** - * Creates or updates a plant tissue analysis resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     fieldId: String (Optional)
-     *     cropId: String (Optional)
-     *     cropProductId: String (Optional)
-     *     seasonId: String (Optional)
-     *     plantingDateTime: OffsetDateTime (Optional)
-     *     growthStage: String (Optional)
-     *     plantPart: String (Optional)
-     *     plantPosition: String (Optional)
-     *     plantAppearance: String (Optional)
-     *     sampleCollectionCondition: String (Optional)
-     *     sampleCollectionDateTime: OffsetDateTime (Optional)
-     *     sampleReceivedDateTime: OffsetDateTime (Optional)
-     *     sampleTestResultDateTime: OffsetDateTime (Optional)
-     *     labDetails (Optional): {
-     *         code: String (Optional)
-     *         name: String (Optional)
-     *         description: String (Optional)
-     *         address: String (Optional)
-     *     }
-     *     attachmentsLink: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     fieldId: String (Optional)
-     *     cropId: String (Optional)
-     *     cropProductId: String (Optional)
-     *     seasonId: String (Optional)
-     *     plantingDateTime: OffsetDateTime (Optional)
-     *     growthStage: String (Optional)
-     *     plantPart: String (Optional)
-     *     plantPosition: String (Optional)
-     *     plantAppearance: String (Optional)
-     *     sampleCollectionCondition: String (Optional)
-     *     sampleCollectionDateTime: OffsetDateTime (Optional)
-     *     sampleReceivedDateTime: OffsetDateTime (Optional)
-     *     sampleTestResultDateTime: OffsetDateTime (Optional)
-     *     labDetails (Optional): {
-     *         code: String (Optional)
-     *         name: String (Optional)
-     *         description: String (Optional)
-     *         address: String (Optional)
-     *     }
-     *     attachmentsLink: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party resource. - * @param plantTissueAnalysisId Id of the plant tissue analysis resource. - * @param plantTissueAnalysis PlantTissueAnalysis resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return api Model for plant tissue analysis object along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String plantTissueAnalysisId, - BinaryData plantTissueAnalysis, RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(partyId, plantTissueAnalysisId, plantTissueAnalysis, requestOptions) - .block(); - } - - /** - * Deletes a specified plant tissue analysis resource under a particular party. - * - * @param partyId Id of the party. - * @param plantTissueAnalysisId Id of the plant tissue analysis. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String partyId, String plantTissueAnalysisId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), partyId, plantTissueAnalysisId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a specified plant tissue analysis resource under a particular party. - * - * @param partyId Id of the party. - * @param plantTissueAnalysisId Id of the plant tissue analysis. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String plantTissueAnalysisId, - RequestOptions requestOptions) { - return deleteWithResponseAsync(partyId, plantTissueAnalysisId, requestOptions).block(); - } - - /** - * Returns a paginated list of plant tissue analysis resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
seasonIdsList<String>NoSeason ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCrop ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
cropProductsIdsList<String>NoCrop products ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     fieldId: String (Optional)
-     *     cropId: String (Optional)
-     *     cropProductId: String (Optional)
-     *     seasonId: String (Optional)
-     *     plantingDateTime: OffsetDateTime (Optional)
-     *     growthStage: String (Optional)
-     *     plantPart: String (Optional)
-     *     plantPosition: String (Optional)
-     *     plantAppearance: String (Optional)
-     *     sampleCollectionCondition: String (Optional)
-     *     sampleCollectionDateTime: OffsetDateTime (Optional)
-     *     sampleReceivedDateTime: OffsetDateTime (Optional)
-     *     sampleTestResultDateTime: OffsetDateTime (Optional)
-     *     labDetails (Optional): {
-     *         code: String (Optional)
-     *         name: String (Optional)
-     *         description: String (Optional)
-     *         address: String (Optional)
-     *     }
-     *     attachmentsLink: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of plant tissue analysis resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
seasonIdsList<String>NoSeason ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCrop ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
cropProductsIdsList<String>NoCrop products ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     fieldId: String (Optional)
-     *     cropId: String (Optional)
-     *     cropProductId: String (Optional)
-     *     seasonId: String (Optional)
-     *     plantingDateTime: OffsetDateTime (Optional)
-     *     growthStage: String (Optional)
-     *     plantPart: String (Optional)
-     *     plantPosition: String (Optional)
-     *     plantAppearance: String (Optional)
-     *     sampleCollectionCondition: String (Optional)
-     *     sampleCollectionDateTime: OffsetDateTime (Optional)
-     *     sampleReceivedDateTime: OffsetDateTime (Optional)
-     *     sampleTestResultDateTime: OffsetDateTime (Optional)
-     *     labDetails (Optional): {
-     *         code: String (Optional)
-     *         name: String (Optional)
-     *         description: String (Optional)
-     *         address: String (Optional)
-     *     }
-     *     attachmentsLink: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of plant tissue analysis resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
seasonIdsList<String>NoSeason ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCrop ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
cropProductsIdsList<String>NoCrop products ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField ids of the plant tissue analyses. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     fieldId: String (Optional)
-     *     cropId: String (Optional)
-     *     cropProductId: String (Optional)
-     *     seasonId: String (Optional)
-     *     plantingDateTime: OffsetDateTime (Optional)
-     *     growthStage: String (Optional)
-     *     plantPart: String (Optional)
-     *     plantPosition: String (Optional)
-     *     plantAppearance: String (Optional)
-     *     sampleCollectionCondition: String (Optional)
-     *     sampleCollectionDateTime: OffsetDateTime (Optional)
-     *     sampleReceivedDateTime: OffsetDateTime (Optional)
-     *     sampleTestResultDateTime: OffsetDateTime (Optional)
-     *     labDetails (Optional): {
-     *         code: String (Optional)
-     *         name: String (Optional)
-     *         description: String (Optional)
-     *         address: String (Optional)
-     *     }
-     *     attachmentsLink: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(requestOptions)); - } - - /** - * Create a cascade delete job for specified plant tissue analysis. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param plantTissueAnalysisId ID of the plant tissue analysis to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of cascade delete job along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createCascadeDeleteJobWithResponseAsync(String jobId, String partyId, - String plantTissueAnalysisId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createCascadeDeleteJob(this.client.getEndpoint(), jobId, partyId, - plantTissueAnalysisId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Create a cascade delete job for specified plant tissue analysis. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param plantTissueAnalysisId ID of the plant tissue analysis to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJobAsync(String jobId, String partyId, - String plantTissueAnalysisId, RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createCascadeDeleteJobWithResponseAsync(jobId, partyId, plantTissueAnalysisId, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Create a cascade delete job for specified plant tissue analysis. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param plantTissueAnalysisId ID of the plant tissue analysis to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, - String plantTissueAnalysisId, RequestOptions requestOptions) { - return this.beginCreateCascadeDeleteJobAsync(jobId, partyId, plantTissueAnalysisId, requestOptions) - .getSyncPoller(); - } - - /** - * Get a cascade delete job for specified plant tissue analysis. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified plant tissue analysis along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponseAsync(String jobId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getCascadeDeleteJobDetails(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get a cascade delete job for specified plant tissue analysis. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified plant tissue analysis along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions).block(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     fieldId: String (Optional)
-     *     cropId: String (Optional)
-     *     cropProductId: String (Optional)
-     *     seasonId: String (Optional)
-     *     plantingDateTime: OffsetDateTime (Optional)
-     *     growthStage: String (Optional)
-     *     plantPart: String (Optional)
-     *     plantPosition: String (Optional)
-     *     plantAppearance: String (Optional)
-     *     sampleCollectionCondition: String (Optional)
-     *     sampleCollectionDateTime: OffsetDateTime (Optional)
-     *     sampleReceivedDateTime: OffsetDateTime (Optional)
-     *     sampleTestResultDateTime: OffsetDateTime (Optional)
-     *     labDetails (Optional): {
-     *         code: String (Optional)
-     *         name: String (Optional)
-     *         description: String (Optional)
-     *         address: String (Optional)
-     *     }
-     *     attachmentsLink: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listByPartyIdNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     fieldId: String (Optional)
-     *     cropId: String (Optional)
-     *     cropProductId: String (Optional)
-     *     seasonId: String (Optional)
-     *     plantingDateTime: OffsetDateTime (Optional)
-     *     growthStage: String (Optional)
-     *     plantPart: String (Optional)
-     *     plantPosition: String (Optional)
-     *     plantAppearance: String (Optional)
-     *     sampleCollectionCondition: String (Optional)
-     *     sampleCollectionDateTime: OffsetDateTime (Optional)
-     *     sampleReceivedDateTime: OffsetDateTime (Optional)
-     *     sampleTestResultDateTime: OffsetDateTime (Optional)
-     *     labDetails (Optional): {
-     *         code: String (Optional)
-     *         name: String (Optional)
-     *         description: String (Optional)
-     *         address: String (Optional)
-     *     }
-     *     attachmentsLink: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/PlantingDatasImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/PlantingDatasImpl.java deleted file mode 100644 index b8e823e1bee9..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/PlantingDatasImpl.java +++ /dev/null @@ -1,1457 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.DefaultPollingStrategy; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.core.util.serializer.TypeReference; -import java.time.Duration; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PlantingDatas. */ -public final class PlantingDatasImpl { - /** The proxy service used to perform REST calls. */ - private final PlantingDatasService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of PlantingDatasImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PlantingDatasImpl(FarmBeatsClientImpl client) { - this.service - = RestProxy.create(PlantingDatasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientPlantingDatas to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientPlant") - public interface PlantingDatasService { - @Get("/parties/{partyId}/planting-data") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyId(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/planting-data/{plantingDataId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("plantingDataId") String plantingDataId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Patch("/parties/{partyId}/planting-data/{plantingDataId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @PathParam("plantingDataId") String plantingDataId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData plantingData, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/parties/{partyId}/planting-data/{plantingDataId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("plantingDataId") String plantingDataId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/planting-data") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Put("/planting-data/cascade-delete/{jobId}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createCascadeDeleteJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("partyId") String partyId, - @QueryParam("plantingDataId") String plantingDataId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/planting-data/cascade-delete/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getCascadeDeleteJobDetails(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyIdNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of planting data resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minAvgPlantingRateDoubleNoMinimum AvgPlantingRate value(inclusive).
maxAvgPlantingRateDoubleNoMaximum AvgPlantingRate value (inclusive).
minTotalMaterialDoubleNoMinimum TotalMaterial value(inclusive).
maxTotalMaterialDoubleNoMaximum TotalMaterial value (inclusive).
minAvgMaterialDoubleNoMinimum AvgMaterial value(inclusive).
maxAvgMaterialDoubleNoMaximum AvgMaterial value (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     avgPlantingRate (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     plantingProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *             avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdSinglePageAsync(String partyId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByPartyId(this.client.getEndpoint(), partyId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of planting data resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minAvgPlantingRateDoubleNoMinimum AvgPlantingRate value(inclusive).
maxAvgPlantingRateDoubleNoMaximum AvgPlantingRate value (inclusive).
minTotalMaterialDoubleNoMinimum TotalMaterial value(inclusive).
maxTotalMaterialDoubleNoMaximum TotalMaterial value (inclusive).
minAvgMaterialDoubleNoMinimum AvgMaterial value(inclusive).
maxAvgMaterialDoubleNoMaximum AvgMaterial value (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     avgPlantingRate (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     plantingProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *             avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyIdAsync(String partyId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listByPartyIdSinglePageAsync(partyId, requestOptions), - nextLink -> listByPartyIdNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of planting data resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minAvgPlantingRateDoubleNoMinimum AvgPlantingRate value(inclusive).
maxAvgPlantingRateDoubleNoMaximum AvgPlantingRate value (inclusive).
minTotalMaterialDoubleNoMinimum TotalMaterial value(inclusive).
maxTotalMaterialDoubleNoMaximum TotalMaterial value (inclusive).
minAvgMaterialDoubleNoMinimum AvgMaterial value(inclusive).
maxAvgMaterialDoubleNoMaximum AvgMaterial value (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     avgPlantingRate (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     plantingProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *             avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(listByPartyIdAsync(partyId, requestOptions)); - } - - /** - * Get a specified planting data resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     avgPlantingRate (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     plantingProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *             avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party resource. - * @param plantingDataId ID of the planting data resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified planting data resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String partyId, String plantingDataId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), partyId, plantingDataId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get a specified planting data resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     avgPlantingRate (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     plantingProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *             avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party resource. - * @param plantingDataId ID of the planting data resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified planting data resource under a particular party along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String plantingDataId, RequestOptions requestOptions) { - return getWithResponseAsync(partyId, plantingDataId, requestOptions).block(); - } - - /** - * Creates or updates an planting data resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     avgPlantingRate (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     plantingProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *             avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     avgPlantingRate (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     plantingProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *             avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param plantingDataId ID of the planting data resource. - * @param plantingData Planting data resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of planting data resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String partyId, String plantingDataId, - BinaryData plantingData, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), partyId, plantingDataId, - this.client.getServiceVersion().getVersion(), plantingData, accept, requestOptions, context)); - } - - /** - * Creates or updates an planting data resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     avgPlantingRate (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     plantingProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *             avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     avgPlantingRate (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     plantingProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *             avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param plantingDataId ID of the planting data resource. - * @param plantingData Planting data resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of planting data resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String plantingDataId, - BinaryData plantingData, RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(partyId, plantingDataId, plantingData, requestOptions).block(); - } - - /** - * Deletes a specified planting data resource under a particular party. - * - * @param partyId ID of the associated party resource. - * @param plantingDataId ID of the planting data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String partyId, String plantingDataId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), partyId, plantingDataId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a specified planting data resource under a particular party. - * - * @param partyId ID of the associated party resource. - * @param plantingDataId ID of the planting data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String plantingDataId, RequestOptions requestOptions) { - return deleteWithResponseAsync(partyId, plantingDataId, requestOptions).block(); - } - - /** - * Returns a paginated list of planting data resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minAvgPlantingRateDoubleNoMinimum AvgPlantingRate value(inclusive).
maxAvgPlantingRateDoubleNoMaximum AvgPlantingRate value (inclusive).
minTotalMaterialDoubleNoMinimum TotalMaterial value(inclusive).
maxTotalMaterialDoubleNoMaximum TotalMaterial value (inclusive).
minAvgMaterialDoubleNoMinimum AvgMaterial value(inclusive).
maxAvgMaterialDoubleNoMaximum AvgMaterial value (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     avgPlantingRate (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     plantingProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *             avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of planting data resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minAvgPlantingRateDoubleNoMinimum AvgPlantingRate value(inclusive).
maxAvgPlantingRateDoubleNoMaximum AvgPlantingRate value (inclusive).
minTotalMaterialDoubleNoMinimum TotalMaterial value(inclusive).
maxTotalMaterialDoubleNoMaximum TotalMaterial value (inclusive).
minAvgMaterialDoubleNoMinimum AvgMaterial value(inclusive).
maxAvgMaterialDoubleNoMaximum AvgMaterial value (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     avgPlantingRate (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     plantingProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *             avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of planting data resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minAvgPlantingRateDoubleNoMinimum AvgPlantingRate value(inclusive).
maxAvgPlantingRateDoubleNoMaximum AvgPlantingRate value (inclusive).
minTotalMaterialDoubleNoMinimum TotalMaterial value(inclusive).
maxTotalMaterialDoubleNoMaximum TotalMaterial value (inclusive).
minAvgMaterialDoubleNoMinimum AvgMaterial value(inclusive).
maxAvgMaterialDoubleNoMaximum AvgMaterial value (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     avgPlantingRate (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     plantingProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *             avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(requestOptions)); - } - - /** - * Create cascade delete job for planting data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param partyId Id of the party. - * @param plantingDataId Id of the planting data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of cascade delete job along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createCascadeDeleteJobWithResponseAsync(String jobId, String partyId, - String plantingDataId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createCascadeDeleteJob(this.client.getEndpoint(), jobId, partyId, - plantingDataId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Create cascade delete job for planting data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param partyId Id of the party. - * @param plantingDataId Id of the planting data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJobAsync(String jobId, String partyId, - String plantingDataId, RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createCascadeDeleteJobWithResponseAsync(jobId, partyId, plantingDataId, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Create cascade delete job for planting data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param partyId Id of the party. - * @param plantingDataId Id of the planting data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, - String plantingDataId, RequestOptions requestOptions) { - return this.beginCreateCascadeDeleteJobAsync(jobId, partyId, plantingDataId, requestOptions).getSyncPoller(); - } - - /** - * Get cascade delete job for planting data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for planting data resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponseAsync(String jobId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getCascadeDeleteJobDetails(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get cascade delete job for planting data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for planting data resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions).block(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     avgPlantingRate (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     plantingProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *             avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listByPartyIdNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     avgPlantingRate (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *     avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *     plantingProductDetails (Optional): [
-     *          (Optional){
-     *             productName: String (Optional)
-     *             area (Optional): (recursive schema, see area above)
-     *             totalMaterial (Optional): (recursive schema, see totalMaterial above)
-     *             avgMaterial (Optional): (recursive schema, see avgMaterial above)
-     *         }
-     *     ]
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/PrescriptionMapsImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/PrescriptionMapsImpl.java deleted file mode 100644 index c7f875e454fe..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/PrescriptionMapsImpl.java +++ /dev/null @@ -1,1169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.DefaultPollingStrategy; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.core.util.serializer.TypeReference; -import java.time.Duration; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrescriptionMaps. */ -public final class PrescriptionMapsImpl { - /** The proxy service used to perform REST calls. */ - private final PrescriptionMapsService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of PrescriptionMapsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrescriptionMapsImpl(FarmBeatsClientImpl client) { - this.service - = RestProxy.create(PrescriptionMapsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientPrescriptionMaps to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientPresc") - public interface PrescriptionMapsService { - @Get("/parties/{partyId}/prescription-maps") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyId(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/prescription-maps/{prescriptionMapId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("prescriptionMapId") String prescriptionMapId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Patch("/parties/{partyId}/prescription-maps/{prescriptionMapId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @PathParam("prescriptionMapId") String prescriptionMapId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData prescriptionMap, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/parties/{partyId}/prescription-maps/{prescriptionMapId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("prescriptionMapId") String prescriptionMapId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/prescription-maps") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/prescription-maps/cascade-delete/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getCascadeDeleteJobDetails(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Put("/prescription-maps/cascade-delete/{jobId}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createCascadeDeleteJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("partyId") String partyId, - @QueryParam("prescriptionMapId") String prescriptionMapId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyIdNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of prescription map resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCrop Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeason Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources for the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdSinglePageAsync(String partyId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByPartyId(this.client.getEndpoint(), partyId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of prescription map resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCrop Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeason Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources for the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyIdAsync(String partyId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listByPartyIdSinglePageAsync(partyId, requestOptions), - nextLink -> listByPartyIdNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of prescription map resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCrop Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeason Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources for the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(listByPartyIdAsync(partyId, requestOptions)); - } - - /** - * Gets a specified prescription map resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param prescriptionMapId Id of the prescription map. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified prescription map resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String partyId, String prescriptionMapId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), partyId, prescriptionMapId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Gets a specified prescription map resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param prescriptionMapId Id of the prescription map. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified prescription map resource under a particular party along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String prescriptionMapId, - RequestOptions requestOptions) { - return getWithResponseAsync(partyId, prescriptionMapId, requestOptions).block(); - } - - /** - * Creates or Updates a prescription map resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party resource. - * @param prescriptionMapId Id of the prescription map resource. - * @param prescriptionMap PrescriptionMap resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return api Model for Prescription Map object along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String partyId, String prescriptionMapId, - BinaryData prescriptionMap, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), partyId, prescriptionMapId, - this.client.getServiceVersion().getVersion(), prescriptionMap, accept, requestOptions, context)); - } - - /** - * Creates or Updates a prescription map resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party resource. - * @param prescriptionMapId Id of the prescription map resource. - * @param prescriptionMap PrescriptionMap resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return api Model for Prescription Map object along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String prescriptionMapId, - BinaryData prescriptionMap, RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(partyId, prescriptionMapId, prescriptionMap, requestOptions).block(); - } - - /** - * Deletes a specified prescription map resource under a particular party. - * - * @param partyId Id of the party. - * @param prescriptionMapId Id of the prescriptionMap. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String partyId, String prescriptionMapId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), partyId, prescriptionMapId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a specified prescription map resource under a particular party. - * - * @param partyId Id of the party. - * @param prescriptionMapId Id of the prescriptionMap. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String prescriptionMapId, RequestOptions requestOptions) { - return deleteWithResponseAsync(partyId, prescriptionMapId, requestOptions).block(); - } - - /** - * Returns a paginated list of prescription map resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCrop Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeason Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources for the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of prescription map resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCrop Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeason Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources for the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of prescription map resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoCrop Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeason Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources for the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(requestOptions)); - } - - /** - * Get a cascade delete job for specified prescription map. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified prescription map along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponseAsync(String jobId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getCascadeDeleteJobDetails(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get a cascade delete job for specified prescription map. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified prescription map along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions).block(); - } - - /** - * Create a cascade delete job for specified prescription map. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param prescriptionMapId ID of the prescription map to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of cascade delete job along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createCascadeDeleteJobWithResponseAsync(String jobId, String partyId, - String prescriptionMapId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createCascadeDeleteJob(this.client.getEndpoint(), jobId, partyId, - prescriptionMapId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Create a cascade delete job for specified prescription map. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param prescriptionMapId ID of the prescription map to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJobAsync(String jobId, String partyId, - String prescriptionMapId, RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createCascadeDeleteJobWithResponseAsync(jobId, partyId, prescriptionMapId, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Create a cascade delete job for specified prescription map. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param prescriptionMapId ID of the prescription map to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, - String prescriptionMapId, RequestOptions requestOptions) { - return this.beginCreateCascadeDeleteJobAsync(jobId, partyId, prescriptionMapId, requestOptions).getSyncPoller(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listByPartyIdNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropId: String (Optional)
-     *     fieldId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/PrescriptionsImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/PrescriptionsImpl.java deleted file mode 100644 index 83553c728e21..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/PrescriptionsImpl.java +++ /dev/null @@ -1,1251 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.DefaultPollingStrategy; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.core.util.serializer.TypeReference; -import java.time.Duration; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in Prescriptions. */ -public final class PrescriptionsImpl { - /** The proxy service used to perform REST calls. */ - private final PrescriptionsService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of PrescriptionsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrescriptionsImpl(FarmBeatsClientImpl client) { - this.service - = RestProxy.create(PrescriptionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientPrescriptions to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientPresc") - public interface PrescriptionsService { - @Get("/parties/{partyId}/prescriptions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyId(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/prescriptions/{prescriptionId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("prescriptionId") String prescriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Patch("/parties/{partyId}/prescriptions/{prescriptionId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @PathParam("prescriptionId") String prescriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData prescription, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/parties/{partyId}/prescriptions/{prescriptionId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("prescriptionId") String prescriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/prescriptions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/prescriptions/cascade-delete/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getCascadeDeleteJobDetails(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Put("/prescriptions/cascade-delete/{jobId}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createCascadeDeleteJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("partyId") String partyId, - @QueryParam("prescriptionId") String prescriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyIdNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of prescription resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
prescriptionMapIdsList<String>NoPrescription Map Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
typesList<String>NoTypes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
productCodesList<String>NoProduct Codes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
productNamesList<String>NoProduct Names of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources for the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     prescriptionMapId: String (Optional)
-     *     productCode: String (Optional)
-     *     productName: String (Optional)
-     *     type: String (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdSinglePageAsync(String partyId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByPartyId(this.client.getEndpoint(), partyId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of prescription resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
prescriptionMapIdsList<String>NoPrescription Map Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
typesList<String>NoTypes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
productCodesList<String>NoProduct Codes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
productNamesList<String>NoProduct Names of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources for the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     prescriptionMapId: String (Optional)
-     *     productCode: String (Optional)
-     *     productName: String (Optional)
-     *     type: String (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyIdAsync(String partyId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listByPartyIdSinglePageAsync(partyId, requestOptions), - nextLink -> listByPartyIdNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of prescription resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
prescriptionMapIdsList<String>NoPrescription Map Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
typesList<String>NoTypes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
productCodesList<String>NoProduct Codes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
productNamesList<String>NoProduct Names of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources for the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     prescriptionMapId: String (Optional)
-     *     productCode: String (Optional)
-     *     productName: String (Optional)
-     *     type: String (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(listByPartyIdAsync(partyId, requestOptions)); - } - - /** - * Gets a specified prescription resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     prescriptionMapId: String (Optional)
-     *     productCode: String (Optional)
-     *     productName: String (Optional)
-     *     type: String (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param prescriptionId Id of the prescription. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified prescription resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String partyId, String prescriptionId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), partyId, prescriptionId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Gets a specified prescription resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     prescriptionMapId: String (Optional)
-     *     productCode: String (Optional)
-     *     productName: String (Optional)
-     *     type: String (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param prescriptionId Id of the prescription. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified prescription resource under a particular party along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String prescriptionId, RequestOptions requestOptions) { - return getWithResponseAsync(partyId, prescriptionId, requestOptions).block(); - } - - /** - * Creates or Updates a prescription resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     prescriptionMapId: String (Optional)
-     *     productCode: String (Optional)
-     *     productName: String (Optional)
-     *     type: String (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     prescriptionMapId: String (Optional)
-     *     productCode: String (Optional)
-     *     productName: String (Optional)
-     *     type: String (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party resource. - * @param prescriptionId Id of the prescription resource. - * @param prescription Prescription resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return api Model for Prescription object along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String partyId, String prescriptionId, - BinaryData prescription, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), partyId, prescriptionId, - this.client.getServiceVersion().getVersion(), prescription, accept, requestOptions, context)); - } - - /** - * Creates or Updates a prescription resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     prescriptionMapId: String (Optional)
-     *     productCode: String (Optional)
-     *     productName: String (Optional)
-     *     type: String (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     prescriptionMapId: String (Optional)
-     *     productCode: String (Optional)
-     *     productName: String (Optional)
-     *     type: String (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party resource. - * @param prescriptionId Id of the prescription resource. - * @param prescription Prescription resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return api Model for Prescription object along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String prescriptionId, - BinaryData prescription, RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(partyId, prescriptionId, prescription, requestOptions).block(); - } - - /** - * Deletes a specified prescription resource under a particular party. - * - * @param partyId Id of the party. - * @param prescriptionId Id of the prescription. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String partyId, String prescriptionId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), partyId, prescriptionId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a specified prescription resource under a particular party. - * - * @param partyId Id of the party. - * @param prescriptionId Id of the prescription. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String prescriptionId, RequestOptions requestOptions) { - return deleteWithResponseAsync(partyId, prescriptionId, requestOptions).block(); - } - - /** - * Returns a paginated list of prescription resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
prescriptionMapIdsList<String>NoPrescription Map Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
typesList<String>NoTypes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
productCodesList<String>NoProduct Codes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
productNamesList<String>NoProduct Names of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources for the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     prescriptionMapId: String (Optional)
-     *     productCode: String (Optional)
-     *     productName: String (Optional)
-     *     type: String (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of prescription resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
prescriptionMapIdsList<String>NoPrescription Map Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
typesList<String>NoTypes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
productCodesList<String>NoProduct Codes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
productNamesList<String>NoProduct Names of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources for the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     prescriptionMapId: String (Optional)
-     *     productCode: String (Optional)
-     *     productName: String (Optional)
-     *     type: String (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of prescription resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
prescriptionMapIdsList<String>NoPrescription Map Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
typesList<String>NoTypes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
productCodesList<String>NoProduct Codes of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
productNamesList<String>NoProduct Names of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources for the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     prescriptionMapId: String (Optional)
-     *     productCode: String (Optional)
-     *     productName: String (Optional)
-     *     type: String (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(requestOptions)); - } - - /** - * Get a cascade delete job for specified prescription. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified prescription along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponseAsync(String jobId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getCascadeDeleteJobDetails(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get a cascade delete job for specified prescription. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified prescription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions).block(); - } - - /** - * Create a cascade delete job for specified prescription. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param prescriptionId ID of the prescription to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of cascade delete job along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createCascadeDeleteJobWithResponseAsync(String jobId, String partyId, - String prescriptionId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createCascadeDeleteJob(this.client.getEndpoint(), jobId, partyId, - prescriptionId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Create a cascade delete job for specified prescription. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param prescriptionId ID of the prescription to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJobAsync(String jobId, String partyId, - String prescriptionId, RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createCascadeDeleteJobWithResponseAsync(jobId, partyId, prescriptionId, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Create a cascade delete job for specified prescription. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param prescriptionId ID of the prescription to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, - String prescriptionId, RequestOptions requestOptions) { - return this.beginCreateCascadeDeleteJobAsync(jobId, partyId, prescriptionId, requestOptions).getSyncPoller(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     prescriptionMapId: String (Optional)
-     *     productCode: String (Optional)
-     *     productName: String (Optional)
-     *     type: String (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listByPartyIdNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     prescriptionMapId: String (Optional)
-     *     productCode: String (Optional)
-     *     productName: String (Optional)
-     *     type: String (Optional)
-     *     measurements (Optional): {
-     *         String (Optional): {
-     *             unit: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     }
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/ScenesImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/ScenesImpl.java deleted file mode 100644 index 6c6c99953bb1..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/ScenesImpl.java +++ /dev/null @@ -1,1183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.DefaultPollingStrategy; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.core.util.serializer.TypeReference; -import java.time.Duration; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in Scenes. */ -public final class ScenesImpl { - /** The proxy service used to perform REST calls. */ - private final ScenesService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of ScenesImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ScenesImpl(FarmBeatsClientImpl client) { - this.service = RestProxy.create(ScenesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientScenes to be used by the proxy service to perform REST - * calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientScene") - public interface ScenesService { - @Get("/scenes") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("provider") String provider, - @QueryParam("partyId") String partyId, @QueryParam("boundaryId") String boundaryId, - @QueryParam("source") String source, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/scenes/downloadFiles") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> download(@HostParam("endpoint") String endpoint, - @QueryParam("filePath") String filePath, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Put("/scenes/satellite/ingest-data/{jobId}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createSatelliteDataIngestionJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BinaryData job, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/scenes/satellite/ingest-data/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getSatelliteDataIngestionJobDetails(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Post("/scenes/stac-collections/{collectionId}:search") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> searchFeatures(@HostParam("endpoint") String endpoint, - @PathParam("collectionId") String collectionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BinaryData searchFeaturesQuery, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/scenes/stac-collections/{collectionId}/features/{featureId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getStacFeature(@HostParam("endpoint") String endpoint, - @PathParam("collectionId") String collectionId, @PathParam("featureId") String featureId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of scene resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
startDateTimeOffsetDateTimeNoScene start UTC datetime (inclusive), sample format: yyyy-MM-ddThh:mm:ssZ.
endDateTimeOffsetDateTimeNoScene end UTC datetime (inclusive), sample format: yyyy-MM-dThh:mm:ssZ.
maxCloudCoveragePercentageDoubleNoFilter scenes with cloud coverage percentage less than max value. Range [0 to 100.0].
maxDarkPixelCoveragePercentageDoubleNoFilter scenes with dark pixel coverage percentage less than max value. Range [0 to 100.0].
imageNamesList<String>NoList of image names to be filtered. Call {@link RequestOptions#addQueryParam} to add string to array.
imageResolutionsList<Double>NoList of image resolutions in meters to be filtered. Call {@link RequestOptions#addQueryParam} to add string to array.
imageFormatsList<String>NoList of image formats to be filtered. Call {@link RequestOptions#addQueryParam} to add string to array.
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sceneDateTime: OffsetDateTime (Optional)
-     *     provider: String (Optional)
-     *     source: String (Optional)
-     *     imageFiles (Optional): [
-     *          (Optional){
-     *             fileLink: String (Optional)
-     *             name: String (Required)
-     *             imageFormat: String(TIF) (Optional)
-     *             resolution: Double (Optional)
-     *         }
-     *     ]
-     *     imageFormat: String(TIF) (Optional)
-     *     cloudCoverPercentage: Double (Optional)
-     *     darkPixelPercentage: Double (Optional)
-     *     ndviMedianValue: Double (Optional)
-     *     boundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param provider Provider name of scene data. - * @param partyId PartyId. - * @param boundaryId BoundaryId. - * @param source Source name of scene data, Available Values: Sentinel_2_L2A, Sentinel_2_L1C. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String provider, String partyId, String boundaryId, - String source, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), provider, partyId, boundaryId, source, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of scene resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
startDateTimeOffsetDateTimeNoScene start UTC datetime (inclusive), sample format: yyyy-MM-ddThh:mm:ssZ.
endDateTimeOffsetDateTimeNoScene end UTC datetime (inclusive), sample format: yyyy-MM-dThh:mm:ssZ.
maxCloudCoveragePercentageDoubleNoFilter scenes with cloud coverage percentage less than max value. Range [0 to 100.0].
maxDarkPixelCoveragePercentageDoubleNoFilter scenes with dark pixel coverage percentage less than max value. Range [0 to 100.0].
imageNamesList<String>NoList of image names to be filtered. Call {@link RequestOptions#addQueryParam} to add string to array.
imageResolutionsList<Double>NoList of image resolutions in meters to be filtered. Call {@link RequestOptions#addQueryParam} to add string to array.
imageFormatsList<String>NoList of image formats to be filtered. Call {@link RequestOptions#addQueryParam} to add string to array.
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sceneDateTime: OffsetDateTime (Optional)
-     *     provider: String (Optional)
-     *     source: String (Optional)
-     *     imageFiles (Optional): [
-     *          (Optional){
-     *             fileLink: String (Optional)
-     *             name: String (Required)
-     *             imageFormat: String(TIF) (Optional)
-     *             resolution: Double (Optional)
-     *         }
-     *     ]
-     *     imageFormat: String(TIF) (Optional)
-     *     cloudCoverPercentage: Double (Optional)
-     *     darkPixelPercentage: Double (Optional)
-     *     ndviMedianValue: Double (Optional)
-     *     boundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param provider Provider name of scene data. - * @param partyId PartyId. - * @param boundaryId BoundaryId. - * @param source Source name of scene data, Available Values: Sentinel_2_L2A, Sentinel_2_L1C. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String provider, String partyId, String boundaryId, String source, - RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(provider, partyId, boundaryId, source, requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of scene resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
startDateTimeOffsetDateTimeNoScene start UTC datetime (inclusive), sample format: yyyy-MM-ddThh:mm:ssZ.
endDateTimeOffsetDateTimeNoScene end UTC datetime (inclusive), sample format: yyyy-MM-dThh:mm:ssZ.
maxCloudCoveragePercentageDoubleNoFilter scenes with cloud coverage percentage less than max value. Range [0 to 100.0].
maxDarkPixelCoveragePercentageDoubleNoFilter scenes with dark pixel coverage percentage less than max value. Range [0 to 100.0].
imageNamesList<String>NoList of image names to be filtered. Call {@link RequestOptions#addQueryParam} to add string to array.
imageResolutionsList<Double>NoList of image resolutions in meters to be filtered. Call {@link RequestOptions#addQueryParam} to add string to array.
imageFormatsList<String>NoList of image formats to be filtered. Call {@link RequestOptions#addQueryParam} to add string to array.
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sceneDateTime: OffsetDateTime (Optional)
-     *     provider: String (Optional)
-     *     source: String (Optional)
-     *     imageFiles (Optional): [
-     *          (Optional){
-     *             fileLink: String (Optional)
-     *             name: String (Required)
-     *             imageFormat: String(TIF) (Optional)
-     *             resolution: Double (Optional)
-     *         }
-     *     ]
-     *     imageFormat: String(TIF) (Optional)
-     *     cloudCoverPercentage: Double (Optional)
-     *     darkPixelPercentage: Double (Optional)
-     *     ndviMedianValue: Double (Optional)
-     *     boundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param provider Provider name of scene data. - * @param partyId PartyId. - * @param boundaryId BoundaryId. - * @param source Source name of scene data, Available Values: Sentinel_2_L2A, Sentinel_2_L1C. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String provider, String partyId, String boundaryId, String source, - RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(provider, partyId, boundaryId, source, requestOptions)); - } - - /** - * Downloads and returns file Stream as response for the given input filePath. - * - *

Response Body Schema - * - *

{@code
-     * BinaryData
-     * }
- * - * @param filePath cloud storage path of scene file. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> downloadWithResponseAsync(String filePath, RequestOptions requestOptions) { - final String accept = "application/json, application/octet-stream"; - return FluxUtil.withContext(context -> service.download(this.client.getEndpoint(), filePath, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Downloads and returns file Stream as response for the given input filePath. - * - *

Response Body Schema - * - *

{@code
-     * BinaryData
-     * }
- * - * @param filePath cloud storage path of scene file. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response downloadWithResponse(String filePath, RequestOptions requestOptions) { - return downloadWithResponseAsync(filePath, requestOptions).block(); - } - - /** - * Create a satellite data ingestion job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     startDateTime: OffsetDateTime (Required)
-     *     endDateTime: OffsetDateTime (Required)
-     *     provider: String(Microsoft) (Optional)
-     *     source: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     data (Optional): {
-     *         imageNames (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageFormats (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageResolutions (Optional): [
-     *             double (Optional)
-     *         ]
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     startDateTime: OffsetDateTime (Required)
-     *     endDateTime: OffsetDateTime (Required)
-     *     provider: String(Microsoft) (Optional)
-     *     source: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     data (Optional): {
-     *         imageNames (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageFormats (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageResolutions (Optional): [
-     *             double (Optional)
-     *         ]
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId JobId provided by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of satellite data ingestion job along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createSatelliteDataIngestionJobWithResponseAsync(String jobId, BinaryData job, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createSatelliteDataIngestionJob(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), job, accept, requestOptions, context)); - } - - /** - * Create a satellite data ingestion job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     startDateTime: OffsetDateTime (Required)
-     *     endDateTime: OffsetDateTime (Required)
-     *     provider: String(Microsoft) (Optional)
-     *     source: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     data (Optional): {
-     *         imageNames (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageFormats (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageResolutions (Optional): [
-     *             double (Optional)
-     *         ]
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     startDateTime: OffsetDateTime (Required)
-     *     endDateTime: OffsetDateTime (Required)
-     *     provider: String(Microsoft) (Optional)
-     *     source: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     data (Optional): {
-     *         imageNames (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageFormats (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageResolutions (Optional): [
-     *             double (Optional)
-     *         ]
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId JobId provided by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of satellite data ingestion job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateSatelliteDataIngestionJobAsync(String jobId, BinaryData job, - RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createSatelliteDataIngestionJobWithResponseAsync(jobId, job, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Create a satellite data ingestion job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     startDateTime: OffsetDateTime (Required)
-     *     endDateTime: OffsetDateTime (Required)
-     *     provider: String(Microsoft) (Optional)
-     *     source: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     data (Optional): {
-     *         imageNames (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageFormats (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageResolutions (Optional): [
-     *             double (Optional)
-     *         ]
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     startDateTime: OffsetDateTime (Required)
-     *     endDateTime: OffsetDateTime (Required)
-     *     provider: String(Microsoft) (Optional)
-     *     source: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     data (Optional): {
-     *         imageNames (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageFormats (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageResolutions (Optional): [
-     *             double (Optional)
-     *         ]
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId JobId provided by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of satellite data ingestion job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateSatelliteDataIngestionJob(String jobId, BinaryData job, - RequestOptions requestOptions) { - return this.beginCreateSatelliteDataIngestionJobAsync(jobId, job, requestOptions).getSyncPoller(); - } - - /** - * Get a satellite data ingestion job. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     startDateTime: OffsetDateTime (Required)
-     *     endDateTime: OffsetDateTime (Required)
-     *     provider: String(Microsoft) (Optional)
-     *     source: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     data (Optional): {
-     *         imageNames (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageFormats (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageResolutions (Optional): [
-     *             double (Optional)
-     *         ]
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a satellite data ingestion job along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSatelliteDataIngestionJobDetailsWithResponseAsync(String jobId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getSatelliteDataIngestionJobDetails(this.client.getEndpoint(), - jobId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get a satellite data ingestion job. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     startDateTime: OffsetDateTime (Required)
-     *     endDateTime: OffsetDateTime (Required)
-     *     provider: String(Microsoft) (Optional)
-     *     source: String(Sentinel_2_L2A/Sentinel_2_L1C) (Required)
-     *     data (Optional): {
-     *         imageNames (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageFormats (Optional): [
-     *             String (Optional)
-     *         ]
-     *         imageResolutions (Optional): [
-     *             double (Optional)
-     *         ]
-     *     }
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a satellite data ingestion job along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSatelliteDataIngestionJobDetailsWithResponse(String jobId, - RequestOptions requestOptions) { - return getSatelliteDataIngestionJobDetailsWithResponseAsync(jobId, requestOptions).block(); - } - - /** - * Search for STAC features by collection id, bbox, intersecting geometry, start and end datetime. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoMaximum number of features needed (inclusive). Minimum = 1, Maximum = 100, Default value = 10.
skipIntegerNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     startDateTime: OffsetDateTime (Required)
-     *     endDateTime: OffsetDateTime (Required)
-     *     intersects (Optional): {
-     *     }
-     *     bbox (Optional): [
-     *         double (Optional)
-     *     ]
-     *     featureIds (Optional): [
-     *         String (Optional)
-     *     ]
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     features (Required): [
-     *          (Required){
-     *             stacVersion: String (Required)
-     *             stacExtensions (Optional): [
-     *                 String (Optional)
-     *             ]
-     *             id: String (Required)
-     *             type: String (Required)
-     *             geometry: Object (Optional)
-     *             bbox (Optional): [
-     *                 double (Optional)
-     *             ]
-     *             properties: Object (Required)
-     *             links (Required): [
-     *                  (Required){
-     *                     href: String (Required)
-     *                     rel: String (Required)
-     *                     type: String (Optional)
-     *                     title: String (Optional)
-     *                 }
-     *             ]
-     *             assets (Required): {
-     *                 String (Required): {
-     *                     href: String (Required)
-     *                     title: String (Optional)
-     *                     description: String (Optional)
-     *                     type: String (Optional)
-     *                     roles (Optional): [
-     *                         String (Optional)
-     *                     ]
-     *                 }
-     *             }
-     *             collection: String (Optional)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
-     * }
-     * }
- * - * @param collectionId Collection Id to be searched. Allowed values: "Sentinel_2_L2A", "Sentinel_2_L1C". - * @param searchFeaturesQuery Query filters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of features and next property to get the next set of results along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> searchFeaturesWithResponseAsync(String collectionId, - BinaryData searchFeaturesQuery, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.searchFeatures(this.client.getEndpoint(), collectionId, - this.client.getServiceVersion().getVersion(), searchFeaturesQuery, accept, requestOptions, context)); - } - - /** - * Search for STAC features by collection id, bbox, intersecting geometry, start and end datetime. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoMaximum number of features needed (inclusive). Minimum = 1, Maximum = 100, Default value = 10.
skipIntegerNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     startDateTime: OffsetDateTime (Required)
-     *     endDateTime: OffsetDateTime (Required)
-     *     intersects (Optional): {
-     *     }
-     *     bbox (Optional): [
-     *         double (Optional)
-     *     ]
-     *     featureIds (Optional): [
-     *         String (Optional)
-     *     ]
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     features (Required): [
-     *          (Required){
-     *             stacVersion: String (Required)
-     *             stacExtensions (Optional): [
-     *                 String (Optional)
-     *             ]
-     *             id: String (Required)
-     *             type: String (Required)
-     *             geometry: Object (Optional)
-     *             bbox (Optional): [
-     *                 double (Optional)
-     *             ]
-     *             properties: Object (Required)
-     *             links (Required): [
-     *                  (Required){
-     *                     href: String (Required)
-     *                     rel: String (Required)
-     *                     type: String (Optional)
-     *                     title: String (Optional)
-     *                 }
-     *             ]
-     *             assets (Required): {
-     *                 String (Required): {
-     *                     href: String (Required)
-     *                     title: String (Optional)
-     *                     description: String (Optional)
-     *                     type: String (Optional)
-     *                     roles (Optional): [
-     *                         String (Optional)
-     *                     ]
-     *                 }
-     *             }
-     *             collection: String (Optional)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
-     * }
-     * }
- * - * @param collectionId Collection Id to be searched. Allowed values: "Sentinel_2_L2A", "Sentinel_2_L1C". - * @param searchFeaturesQuery Query filters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of features and next property to get the next set of results along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response searchFeaturesWithResponse(String collectionId, BinaryData searchFeaturesQuery, - RequestOptions requestOptions) { - return searchFeaturesWithResponseAsync(collectionId, searchFeaturesQuery, requestOptions).block(); - } - - /** - * Get a feature(SpatioTemporal Asset Catalog (STAC) Item) for given collection and feature id. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     stacVersion: String (Required)
-     *     stacExtensions (Optional): [
-     *         String (Optional)
-     *     ]
-     *     id: String (Required)
-     *     type: String (Required)
-     *     geometry: Object (Optional)
-     *     bbox (Optional): [
-     *         double (Optional)
-     *     ]
-     *     properties: Object (Required)
-     *     links (Required): [
-     *          (Required){
-     *             href: String (Required)
-     *             rel: String (Required)
-     *             type: String (Optional)
-     *             title: String (Optional)
-     *         }
-     *     ]
-     *     assets (Required): {
-     *         String (Required): {
-     *             href: String (Required)
-     *             title: String (Optional)
-     *             description: String (Optional)
-     *             type: String (Optional)
-     *             roles (Optional): [
-     *                 String (Optional)
-     *             ]
-     *         }
-     *     }
-     *     collection: String (Optional)
-     * }
-     * }
- * - * @param collectionId Collection Id to be fetched. Allowed values: "Sentinel_2_L2A", "Sentinel_2_L1C". - * @param featureId Feature Id to be fetched. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a feature(SpatioTemporal Asset Catalog (STAC) Item) for given collection and feature id along with {@link - * Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStacFeatureWithResponseAsync(String collectionId, String featureId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getStacFeature(this.client.getEndpoint(), collectionId, - featureId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get a feature(SpatioTemporal Asset Catalog (STAC) Item) for given collection and feature id. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     stacVersion: String (Required)
-     *     stacExtensions (Optional): [
-     *         String (Optional)
-     *     ]
-     *     id: String (Required)
-     *     type: String (Required)
-     *     geometry: Object (Optional)
-     *     bbox (Optional): [
-     *         double (Optional)
-     *     ]
-     *     properties: Object (Required)
-     *     links (Required): [
-     *          (Required){
-     *             href: String (Required)
-     *             rel: String (Required)
-     *             type: String (Optional)
-     *             title: String (Optional)
-     *         }
-     *     ]
-     *     assets (Required): {
-     *         String (Required): {
-     *             href: String (Required)
-     *             title: String (Optional)
-     *             description: String (Optional)
-     *             type: String (Optional)
-     *             roles (Optional): [
-     *                 String (Optional)
-     *             ]
-     *         }
-     *     }
-     *     collection: String (Optional)
-     * }
-     * }
- * - * @param collectionId Collection Id to be fetched. Allowed values: "Sentinel_2_L2A", "Sentinel_2_L1C". - * @param featureId Feature Id to be fetched. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a feature(SpatioTemporal Asset Catalog (STAC) Item) for given collection and feature id along with {@link - * Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getStacFeatureWithResponse(String collectionId, String featureId, - RequestOptions requestOptions) { - return getStacFeatureWithResponseAsync(collectionId, featureId, requestOptions).block(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sceneDateTime: OffsetDateTime (Optional)
-     *     provider: String (Optional)
-     *     source: String (Optional)
-     *     imageFiles (Optional): [
-     *          (Optional){
-     *             fileLink: String (Optional)
-     *             name: String (Required)
-     *             imageFormat: String(TIF) (Optional)
-     *             resolution: Double (Optional)
-     *         }
-     *     ]
-     *     imageFormat: String(TIF) (Optional)
-     *     cloudCoverPercentage: Double (Optional)
-     *     darkPixelPercentage: Double (Optional)
-     *     ndviMedianValue: Double (Optional)
-     *     boundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/SeasonalFieldsImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/SeasonalFieldsImpl.java deleted file mode 100644 index 2e12eccf9e02..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/SeasonalFieldsImpl.java +++ /dev/null @@ -1,1209 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.DefaultPollingStrategy; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.core.util.serializer.TypeReference; -import java.time.Duration; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SeasonalFields. */ -public final class SeasonalFieldsImpl { - /** The proxy service used to perform REST calls. */ - private final SeasonalFieldsService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of SeasonalFieldsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SeasonalFieldsImpl(FarmBeatsClientImpl client) { - this.service - = RestProxy.create(SeasonalFieldsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientSeasonalFields to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientSeaso") - public interface SeasonalFieldsService { - @Get("/parties/{partyId}/seasonal-fields") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyId(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/seasonal-fields/{seasonalFieldId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("seasonalFieldId") String seasonalFieldId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Patch("/parties/{partyId}/seasonal-fields/{seasonalFieldId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @PathParam("seasonalFieldId") String seasonalFieldId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData seasonalField, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/parties/{partyId}/seasonal-fields/{seasonalFieldId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("seasonalFieldId") String seasonalFieldId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/seasonal-fields") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/seasonal-fields/cascade-delete/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getCascadeDeleteJobDetails(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Put("/seasonal-fields/cascade-delete/{jobId}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createCascadeDeleteJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("partyId") String partyId, - @QueryParam("seasonalFieldId") String seasonalFieldId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyIdNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of seasonal field resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
farmIdsList<String>NoFarm Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeason Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropProductIdsList<String>NoCropProductIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoIds of the crop it belongs to. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     farmId: String (Optional)
-     *     fieldId: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropProductIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     cropId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdSinglePageAsync(String partyId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByPartyId(this.client.getEndpoint(), partyId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of seasonal field resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
farmIdsList<String>NoFarm Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeason Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropProductIdsList<String>NoCropProductIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoIds of the crop it belongs to. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     farmId: String (Optional)
-     *     fieldId: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropProductIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     cropId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyIdAsync(String partyId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listByPartyIdSinglePageAsync(partyId, requestOptions), - nextLink -> listByPartyIdNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of seasonal field resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
farmIdsList<String>NoFarm Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeason Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropProductIdsList<String>NoCropProductIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoIds of the crop it belongs to. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     farmId: String (Optional)
-     *     fieldId: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropProductIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     cropId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(listByPartyIdAsync(partyId, requestOptions)); - } - - /** - * Gets a specified seasonal field resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     farmId: String (Optional)
-     *     fieldId: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropProductIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     cropId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param seasonalFieldId Id of the seasonal field. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified seasonal field resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String partyId, String seasonalFieldId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), partyId, seasonalFieldId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Gets a specified seasonal field resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     farmId: String (Optional)
-     *     fieldId: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropProductIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     cropId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param seasonalFieldId Id of the seasonal field. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified seasonal field resource under a particular party along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String seasonalFieldId, RequestOptions requestOptions) { - return getWithResponseAsync(partyId, seasonalFieldId, requestOptions).block(); - } - - /** - * Creates or Updates a seasonal field resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     farmId: String (Optional)
-     *     fieldId: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropProductIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     cropId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     farmId: String (Optional)
-     *     fieldId: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropProductIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     cropId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party resource. - * @param seasonalFieldId Id of the seasonal field resource. - * @param seasonalField Seasonal field resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of seasonal field resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String partyId, String seasonalFieldId, - BinaryData seasonalField, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), partyId, seasonalFieldId, - this.client.getServiceVersion().getVersion(), seasonalField, accept, requestOptions, context)); - } - - /** - * Creates or Updates a seasonal field resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     farmId: String (Optional)
-     *     fieldId: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropProductIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     cropId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     farmId: String (Optional)
-     *     fieldId: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropProductIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     cropId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party resource. - * @param seasonalFieldId Id of the seasonal field resource. - * @param seasonalField Seasonal field resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of seasonal field resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String seasonalFieldId, - BinaryData seasonalField, RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(partyId, seasonalFieldId, seasonalField, requestOptions).block(); - } - - /** - * Deletes a specified seasonal-field resource under a particular party. - * - * @param partyId Id of the party. - * @param seasonalFieldId Id of the seasonal field. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String partyId, String seasonalFieldId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), partyId, seasonalFieldId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a specified seasonal-field resource under a particular party. - * - * @param partyId Id of the party. - * @param seasonalFieldId Id of the seasonal field. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String seasonalFieldId, RequestOptions requestOptions) { - return deleteWithResponseAsync(partyId, seasonalFieldId, requestOptions).block(); - } - - /** - * Returns a paginated list of seasonal field resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
farmIdsList<String>NoFarm Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeason Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropProductIdsList<String>NoCropProductIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoIds of the crop it belongs to. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     farmId: String (Optional)
-     *     fieldId: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropProductIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     cropId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of seasonal field resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
farmIdsList<String>NoFarm Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeason Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropProductIdsList<String>NoCropProductIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoIds of the crop it belongs to. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     farmId: String (Optional)
-     *     fieldId: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropProductIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     cropId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of seasonal field resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
farmIdsList<String>NoFarm Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
fieldIdsList<String>NoField Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
seasonIdsList<String>NoSeason Ids of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropProductIdsList<String>NoCropProductIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
cropIdsList<String>NoIds of the crop it belongs to. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     farmId: String (Optional)
-     *     fieldId: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropProductIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     cropId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(requestOptions)); - } - - /** - * Get cascade delete job for specified seasonal field. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for specified seasonal field along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponseAsync(String jobId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getCascadeDeleteJobDetails(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get cascade delete job for specified seasonal field. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for specified seasonal field along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions).block(); - } - - /** - * Create a cascade delete job for specified seasonal field. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param seasonalFieldId ID of the seasonalField to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of cascade delete job along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createCascadeDeleteJobWithResponseAsync(String jobId, String partyId, - String seasonalFieldId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createCascadeDeleteJob(this.client.getEndpoint(), jobId, partyId, - seasonalFieldId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Create a cascade delete job for specified seasonal field. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param seasonalFieldId ID of the seasonalField to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJobAsync(String jobId, String partyId, - String seasonalFieldId, RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createCascadeDeleteJobWithResponseAsync(jobId, partyId, seasonalFieldId, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Create a cascade delete job for specified seasonal field. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param seasonalFieldId ID of the seasonalField to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, - String seasonalFieldId, RequestOptions requestOptions) { - return this.beginCreateCascadeDeleteJobAsync(jobId, partyId, seasonalFieldId, requestOptions).getSyncPoller(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     farmId: String (Optional)
-     *     fieldId: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropProductIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     cropId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listByPartyIdNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     farmId: String (Optional)
-     *     fieldId: String (Optional)
-     *     seasonId: String (Optional)
-     *     cropProductIds (Optional): [
-     *         String (Optional)
-     *     ]
-     *     cropId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/SeasonsImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/SeasonsImpl.java deleted file mode 100644 index 4298d3cb1ca3..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/SeasonsImpl.java +++ /dev/null @@ -1,639 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in Seasons. */ -public final class SeasonsImpl { - /** The proxy service used to perform REST calls. */ - private final SeasonsService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of SeasonsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SeasonsImpl(FarmBeatsClientImpl client) { - this.service = RestProxy.create(SeasonsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientSeasons to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientSeaso") - public interface SeasonsService { - @Get("/seasons") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/seasons/{seasonId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @PathParam("seasonId") String seasonId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Patch("/seasons/{seasonId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("seasonId") String seasonId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData season, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/seasons/{seasonId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("seasonId") String seasonId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of season resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minStartDateTimeOffsetDateTimeNoMinimum season start datetime, sample format: yyyy-MM-ddTHH:mm:ssZ.
maxStartDateTimeOffsetDateTimeNoMaximum season start datetime, sample format: yyyy-MM-ddTHH:mm:ssZ.
minEndDateTimeOffsetDateTimeNoMinimum season end datetime, sample format: yyyy-MM-ddTHH:mm:ssZ.
maxEndDateTimeOffsetDateTimeNoMaximum season end datetime, sample format: yyyy-MM-ddTHH:mm:ssZ.
yearsList<Integer>NoYears of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     year: Integer (Optional)
-     *     geographicIdentifier: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of season resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minStartDateTimeOffsetDateTimeNoMinimum season start datetime, sample format: yyyy-MM-ddTHH:mm:ssZ.
maxStartDateTimeOffsetDateTimeNoMaximum season start datetime, sample format: yyyy-MM-ddTHH:mm:ssZ.
minEndDateTimeOffsetDateTimeNoMinimum season end datetime, sample format: yyyy-MM-ddTHH:mm:ssZ.
maxEndDateTimeOffsetDateTimeNoMaximum season end datetime, sample format: yyyy-MM-ddTHH:mm:ssZ.
yearsList<Integer>NoYears of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     year: Integer (Optional)
-     *     geographicIdentifier: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of season resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minStartDateTimeOffsetDateTimeNoMinimum season start datetime, sample format: yyyy-MM-ddTHH:mm:ssZ.
maxStartDateTimeOffsetDateTimeNoMaximum season start datetime, sample format: yyyy-MM-ddTHH:mm:ssZ.
minEndDateTimeOffsetDateTimeNoMinimum season end datetime, sample format: yyyy-MM-ddTHH:mm:ssZ.
maxEndDateTimeOffsetDateTimeNoMaximum season end datetime, sample format: yyyy-MM-ddTHH:mm:ssZ.
yearsList<Integer>NoYears of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     year: Integer (Optional)
-     *     geographicIdentifier: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(requestOptions)); - } - - /** - * Gets a specified season resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     year: Integer (Optional)
-     *     geographicIdentifier: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param seasonId Id of the season. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified season resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String seasonId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), seasonId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Gets a specified season resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     year: Integer (Optional)
-     *     geographicIdentifier: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param seasonId Id of the season. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified season resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String seasonId, RequestOptions requestOptions) { - return getWithResponseAsync(seasonId, requestOptions).block(); - } - - /** - * Creates or updates a season resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     year: Integer (Optional)
-     *     geographicIdentifier: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     year: Integer (Optional)
-     *     geographicIdentifier: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param seasonId Id of the season resource. - * @param season Season resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of season resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String seasonId, BinaryData season, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), seasonId, - this.client.getServiceVersion().getVersion(), season, accept, requestOptions, context)); - } - - /** - * Creates or updates a season resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     year: Integer (Optional)
-     *     geographicIdentifier: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     year: Integer (Optional)
-     *     geographicIdentifier: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param seasonId Id of the season resource. - * @param season Season resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of season resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String seasonId, BinaryData season, - RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(seasonId, season, requestOptions).block(); - } - - /** - * Deletes a specified season resource. - * - * @param seasonId Id of the season. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String seasonId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), seasonId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a specified season resource. - * - * @param seasonId Id of the season. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String seasonId, RequestOptions requestOptions) { - return deleteWithResponseAsync(seasonId, requestOptions).block(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     year: Integer (Optional)
-     *     geographicIdentifier: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/SensorDataModelsImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/SensorDataModelsImpl.java deleted file mode 100644 index c66e8f6ad14e..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/SensorDataModelsImpl.java +++ /dev/null @@ -1,743 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SensorDataModels. */ -public final class SensorDataModelsImpl { - /** The proxy service used to perform REST calls. */ - private final SensorDataModelsService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of SensorDataModelsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SensorDataModelsImpl(FarmBeatsClientImpl client) { - this.service - = RestProxy.create(SensorDataModelsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientSensorDataModels to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientSenso") - public interface SensorDataModelsService { - @Get("/sensor-partners/{sensorPartnerId}/sensor-data-models") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @PathParam("sensorPartnerId") String sensorPartnerId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Patch("/sensor-partners/{sensorPartnerId}/sensor-data-models/{sensorDataModelId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("sensorPartnerId") String sensorPartnerId, - @PathParam("sensorDataModelId") String sensorDataModelId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData sensorDataModelObject, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/sensor-partners/{sensorPartnerId}/sensor-data-models/{sensorDataModelId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @PathParam("sensorPartnerId") String sensorPartnerId, - @PathParam("sensorDataModelId") String sensorDataModelId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Delete("/sensor-partners/{sensorPartnerId}/sensor-data-models/{sensorDataModelId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @PathParam("sensorPartnerId") String sensorPartnerId, - @PathParam("sensorDataModelId") String sensorDataModelId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of sensor data model resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     measures (Required): {
-     *         String (Required): {
-     *             description: String (Optional)
-     *             dataType: String(Bool/Double/DateTime/Long/String) (Required)
-     *             type: String (Optional)
-     *             unit: String (Optional)
-     *             properties (Optional): {
-     *                 String: Object (Optional)
-     *             }
-     *         }
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String sensorPartnerId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), sensorPartnerId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of sensor data model resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     measures (Required): {
-     *         String (Required): {
-     *             description: String (Optional)
-     *             dataType: String(Bool/Double/DateTime/Long/String) (Required)
-     *             type: String (Optional)
-     *             unit: String (Optional)
-     *             properties (Optional): {
-     *                 String: Object (Optional)
-     *             }
-     *         }
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String sensorPartnerId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(sensorPartnerId, requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of sensor data model resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     measures (Required): {
-     *         String (Required): {
-     *             description: String (Optional)
-     *             dataType: String(Bool/Double/DateTime/Long/String) (Required)
-     *             type: String (Optional)
-     *             unit: String (Optional)
-     *             properties (Optional): {
-     *                 String: Object (Optional)
-     *             }
-     *         }
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String sensorPartnerId, RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(sensorPartnerId, requestOptions)); - } - - /** - * Create a sensor data model entity. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     measures (Required): {
-     *         String (Required): {
-     *             description: String (Optional)
-     *             dataType: String(Bool/Double/DateTime/Long/String) (Required)
-     *             type: String (Optional)
-     *             unit: String (Optional)
-     *             properties (Optional): {
-     *                 String: Object (Optional)
-     *             }
-     *         }
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     measures (Required): {
-     *         String (Required): {
-     *             description: String (Optional)
-     *             dataType: String(Bool/Double/DateTime/Long/String) (Required)
-     *             type: String (Optional)
-     *             unit: String (Optional)
-     *             properties (Optional): {
-     *                 String: Object (Optional)
-     *             }
-     *         }
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorDataModelId Id of the sensor data model. - * @param sensorDataModelObject Sensor data model object details. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensorModel API model along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String sensorPartnerId, String sensorDataModelId, - BinaryData sensorDataModelObject, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.createOrUpdate(this.client.getEndpoint(), sensorPartnerId, sensorDataModelId, - this.client.getServiceVersion().getVersion(), sensorDataModelObject, accept, requestOptions, context)); - } - - /** - * Create a sensor data model entity. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     measures (Required): {
-     *         String (Required): {
-     *             description: String (Optional)
-     *             dataType: String(Bool/Double/DateTime/Long/String) (Required)
-     *             type: String (Optional)
-     *             unit: String (Optional)
-     *             properties (Optional): {
-     *                 String: Object (Optional)
-     *             }
-     *         }
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     measures (Required): {
-     *         String (Required): {
-     *             description: String (Optional)
-     *             dataType: String(Bool/Double/DateTime/Long/String) (Required)
-     *             type: String (Optional)
-     *             unit: String (Optional)
-     *             properties (Optional): {
-     *                 String: Object (Optional)
-     *             }
-     *         }
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorDataModelId Id of the sensor data model. - * @param sensorDataModelObject Sensor data model object details. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensorModel API model along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String sensorPartnerId, String sensorDataModelId, - BinaryData sensorDataModelObject, RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(sensorPartnerId, sensorDataModelId, sensorDataModelObject, - requestOptions).block(); - } - - /** - * Gets a sensor data model entity. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     measures (Required): {
-     *         String (Required): {
-     *             description: String (Optional)
-     *             dataType: String(Bool/Double/DateTime/Long/String) (Required)
-     *             type: String (Optional)
-     *             unit: String (Optional)
-     *             properties (Optional): {
-     *                 String: Object (Optional)
-     *             }
-     *         }
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorDataModelId Id of the sensor data model resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a sensor data model entity along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String sensorPartnerId, String sensorDataModelId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), sensorPartnerId, - sensorDataModelId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Gets a sensor data model entity. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     measures (Required): {
-     *         String (Required): {
-     *             description: String (Optional)
-     *             dataType: String(Bool/Double/DateTime/Long/String) (Required)
-     *             type: String (Optional)
-     *             unit: String (Optional)
-     *             properties (Optional): {
-     *                 String: Object (Optional)
-     *             }
-     *         }
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorDataModelId Id of the sensor data model resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a sensor data model entity along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String sensorPartnerId, String sensorDataModelId, - RequestOptions requestOptions) { - return getWithResponseAsync(sensorPartnerId, sensorDataModelId, requestOptions).block(); - } - - /** - * Deletes a sensor data model entity. - * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorDataModelId Id of the sensor data model resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String sensorPartnerId, String sensorDataModelId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), sensorPartnerId, - sensorDataModelId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a sensor data model entity. - * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorDataModelId Id of the sensor data model resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String sensorPartnerId, String sensorDataModelId, - RequestOptions requestOptions) { - return deleteWithResponseAsync(sensorPartnerId, sensorDataModelId, requestOptions).block(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     type: String (Optional)
-     *     manufacturer: String (Optional)
-     *     productCode: String (Optional)
-     *     measures (Required): {
-     *         String (Required): {
-     *             description: String (Optional)
-     *             dataType: String(Bool/Double/DateTime/Long/String) (Required)
-     *             type: String (Optional)
-     *             unit: String (Optional)
-     *             properties (Optional): {
-     *                 String: Object (Optional)
-     *             }
-     *         }
-     *     }
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/SensorEventsImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/SensorEventsImpl.java deleted file mode 100644 index 282cc2331730..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/SensorEventsImpl.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SensorEvents. */ -public final class SensorEventsImpl { - /** The proxy service used to perform REST calls. */ - private final SensorEventsService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of SensorEventsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SensorEventsImpl(FarmBeatsClientImpl client) { - this.service - = RestProxy.create(SensorEventsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientSensorEvents to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientSenso") - public interface SensorEventsService { - @Get("/sensor-events") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("sensorId") String sensorId, - @QueryParam("sensorPartnerId") String sensorPartnerId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - } - - /** - * Returns a list of sensor events data. Time span for query is limited to 90 days at a time. Returns last 90 days - * events when startDateTime and endDateTime are not provided. - * - *

Query Parameters - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
startDateTimeOffsetDateTimeNoSearch span start time of sensor events (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ. - * It is truncated upto seconds if fraction is provided.
endDateTimeOffsetDateTimeNoSearch span end time of sensor events (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ. - * It is truncated upto seconds if fraction is provided.
excludeDuplicateEventsBooleanNoFlag to exclude duplicate events and take the latest ones only (Default: true).
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             sensorId: String (Optional)
-     *             sensorPartnerId: String (Optional)
-     *             partyId: String (Optional)
-     *             boundaryId: String (Optional)
-     *             eventDateTime: OffsetDateTime (Optional)
-     *             ingestionDateTime: OffsetDateTime (Optional)
-     *             measures (Optional): {
-     *                 String: Object (Optional)
-     *             }
-     *         }
-     *     ]
-     *     skipToken: String (Optional)
-     *     nextLink: String (Optional)
-     * }
-     * }
- * - * @param sensorId Id of the associated sensor. - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listWithResponseAsync(String sensorId, String sensorPartnerId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), sensorId, sensorPartnerId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Returns a list of sensor events data. Time span for query is limited to 90 days at a time. Returns last 90 days - * events when startDateTime and endDateTime are not provided. - * - *

Query Parameters - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
startDateTimeOffsetDateTimeNoSearch span start time of sensor events (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ. - * It is truncated upto seconds if fraction is provided.
endDateTimeOffsetDateTimeNoSearch span end time of sensor events (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ. - * It is truncated upto seconds if fraction is provided.
excludeDuplicateEventsBooleanNoFlag to exclude duplicate events and take the latest ones only (Default: true).
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             sensorId: String (Optional)
-     *             sensorPartnerId: String (Optional)
-     *             partyId: String (Optional)
-     *             boundaryId: String (Optional)
-     *             eventDateTime: OffsetDateTime (Optional)
-     *             ingestionDateTime: OffsetDateTime (Optional)
-     *             measures (Optional): {
-     *                 String: Object (Optional)
-     *             }
-     *         }
-     *     ]
-     *     skipToken: String (Optional)
-     *     nextLink: String (Optional)
-     * }
-     * }
- * - * @param sensorId Id of the associated sensor. - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String sensorId, String sensorPartnerId, - RequestOptions requestOptions) { - return listWithResponseAsync(sensorId, sensorPartnerId, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/SensorMappingsImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/SensorMappingsImpl.java deleted file mode 100644 index c9ec438e36e5..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/SensorMappingsImpl.java +++ /dev/null @@ -1,627 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SensorMappings. */ -public final class SensorMappingsImpl { - /** The proxy service used to perform REST calls. */ - private final SensorMappingsService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of SensorMappingsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SensorMappingsImpl(FarmBeatsClientImpl client) { - this.service - = RestProxy.create(SensorMappingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientSensorMappings to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientSenso") - public interface SensorMappingsService { - @Get("/sensor-mappings") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Patch("/sensor-mappings/{sensorMappingId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("sensorMappingId") String sensorMappingId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData sensorMappingObject, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/sensor-mappings/{sensorMappingId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @PathParam("sensorMappingId") String sensorMappingId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Delete("/sensor-mappings/{sensorMappingId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @PathParam("sensorMappingId") String sensorMappingId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of sensor mapping resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
sensorIdsList<String>NoId of the sensors. Call {@link RequestOptions#addQueryParam} to add string to array.
sensorPartnerIdsList<String>NoId of the sensor partners. Call {@link RequestOptions#addQueryParam} to add string to array.
partyIdsList<String>NoId of the parties. Call {@link RequestOptions#addQueryParam} to add string to array.
boundaryIdsList<String>NoId of the boundaries. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     partyId: String (Optional)
-     *     boundaryId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of sensor mapping resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
sensorIdsList<String>NoId of the sensors. Call {@link RequestOptions#addQueryParam} to add string to array.
sensorPartnerIdsList<String>NoId of the sensor partners. Call {@link RequestOptions#addQueryParam} to add string to array.
partyIdsList<String>NoId of the parties. Call {@link RequestOptions#addQueryParam} to add string to array.
boundaryIdsList<String>NoId of the boundaries. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     partyId: String (Optional)
-     *     boundaryId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of sensor mapping resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
sensorIdsList<String>NoId of the sensors. Call {@link RequestOptions#addQueryParam} to add string to array.
sensorPartnerIdsList<String>NoId of the sensor partners. Call {@link RequestOptions#addQueryParam} to add string to array.
partyIdsList<String>NoId of the parties. Call {@link RequestOptions#addQueryParam} to add string to array.
boundaryIdsList<String>NoId of the boundaries. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     partyId: String (Optional)
-     *     boundaryId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(requestOptions)); - } - - /** - * Create a sensor mapping entity. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     sensorId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     partyId: String (Optional)
-     *     boundaryId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     partyId: String (Optional)
-     *     boundaryId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorMappingId Id of the sensor mapping. - * @param sensorMappingObject Sensor mapping object details. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensorMapping API model along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String sensorMappingId, - BinaryData sensorMappingObject, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), sensorMappingId, - this.client.getServiceVersion().getVersion(), sensorMappingObject, accept, requestOptions, context)); - } - - /** - * Create a sensor mapping entity. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     sensorId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     partyId: String (Optional)
-     *     boundaryId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     partyId: String (Optional)
-     *     boundaryId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorMappingId Id of the sensor mapping. - * @param sensorMappingObject Sensor mapping object details. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensorMapping API model along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String sensorMappingId, BinaryData sensorMappingObject, - RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(sensorMappingId, sensorMappingObject, requestOptions).block(); - } - - /** - * Gets a sensor mapping entity. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     partyId: String (Optional)
-     *     boundaryId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorMappingId Id of the sensor mapping resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a sensor mapping entity along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String sensorMappingId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), sensorMappingId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Gets a sensor mapping entity. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     partyId: String (Optional)
-     *     boundaryId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorMappingId Id of the sensor mapping resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a sensor mapping entity along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String sensorMappingId, RequestOptions requestOptions) { - return getWithResponseAsync(sensorMappingId, requestOptions).block(); - } - - /** - * Deletes a sensor mapping entity. - * - * @param sensorMappingId Id of the sensor mapping resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String sensorMappingId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), sensorMappingId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a sensor mapping entity. - * - * @param sensorMappingId Id of the sensor mapping resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String sensorMappingId, RequestOptions requestOptions) { - return deleteWithResponseAsync(sensorMappingId, requestOptions).block(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     partyId: String (Optional)
-     *     boundaryId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/SensorPartnerIntegrationsImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/SensorPartnerIntegrationsImpl.java deleted file mode 100644 index 2e47dfd28ec8..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/SensorPartnerIntegrationsImpl.java +++ /dev/null @@ -1,767 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SensorPartnerIntegrations. */ -public final class SensorPartnerIntegrationsImpl { - /** The proxy service used to perform REST calls. */ - private final SensorPartnerIntegrationsService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of SensorPartnerIntegrationsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SensorPartnerIntegrationsImpl(FarmBeatsClientImpl client) { - this.service = RestProxy.create(SensorPartnerIntegrationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientSensorPartnerIntegrations to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientSenso") - public interface SensorPartnerIntegrationsService { - @Get("/sensor-partners/{sensorPartnerId}/integrations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @PathParam("sensorPartnerId") String sensorPartnerId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Patch("/sensor-partners/{sensorPartnerId}/integrations/{integrationId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("sensorPartnerId") String sensorPartnerId, @PathParam("integrationId") String integrationId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData sensorPartnerIntegrationModel, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/sensor-partners/{sensorPartnerId}/integrations/{integrationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @PathParam("sensorPartnerId") String sensorPartnerId, @PathParam("integrationId") String integrationId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/sensor-partners/{sensorPartnerId}/integrations/{integrationId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @PathParam("sensorPartnerId") String sensorPartnerId, @PathParam("integrationId") String integrationId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Post("/sensor-partners/{sensorPartnerId}/integrations/{integrationId}/:check-consent") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> checkConsent(@HostParam("endpoint") String endpoint, - @PathParam("sensorPartnerId") String sensorPartnerId, @PathParam("integrationId") String integrationId, - @QueryParam("key") String key, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Post("/sensor-partners/{sensorPartnerId}/integrations/{integrationId}/:generate-consent-link") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> generateConsentLink(@HostParam("endpoint") String endpoint, - @PathParam("sensorPartnerId") String sensorPartnerId, @PathParam("integrationId") String integrationId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Gets partner integration models. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
integrationIdsList<String>NoIds of the partner integration models. Call {@link RequestOptions#addQueryParam} to add string to array.
partyIdsList<String>NoIds of the parties. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     integrationId: String (Optional)
-     *     partyId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return partner integration models along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String sensorPartnerId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), sensorPartnerId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Gets partner integration models. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
integrationIdsList<String>NoIds of the partner integration models. Call {@link RequestOptions#addQueryParam} to add string to array.
partyIdsList<String>NoIds of the parties. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     integrationId: String (Optional)
-     *     partyId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return partner integration models as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String sensorPartnerId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(sensorPartnerId, requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Gets partner integration models. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
integrationIdsList<String>NoIds of the partner integration models. Call {@link RequestOptions#addQueryParam} to add string to array.
partyIdsList<String>NoIds of the parties. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     integrationId: String (Optional)
-     *     partyId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return partner integration models as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String sensorPartnerId, RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(sensorPartnerId, requestOptions)); - } - - /** - * Create or update an integration with a sensor partner. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     integrationId: String (Optional)
-     *     partyId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     integrationId: String (Optional)
-     *     partyId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param integrationId Id of the integration to be created. - * @param sensorPartnerIntegrationModel Partner integration model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensor partner integration model along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String sensorPartnerId, String integrationId, - BinaryData sensorPartnerIntegrationModel, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), sensorPartnerId, - integrationId, this.client.getServiceVersion().getVersion(), sensorPartnerIntegrationModel, accept, - requestOptions, context)); - } - - /** - * Create or update an integration with a sensor partner. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     integrationId: String (Optional)
-     *     partyId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     integrationId: String (Optional)
-     *     partyId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param integrationId Id of the integration to be created. - * @param sensorPartnerIntegrationModel Partner integration model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensor partner integration model along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String sensorPartnerId, String integrationId, - BinaryData sensorPartnerIntegrationModel, RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(sensorPartnerId, integrationId, sensorPartnerIntegrationModel, - requestOptions).block(); - } - - /** - * Gets a partner integration model entity. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     integrationId: String (Optional)
-     *     partyId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param integrationId Id of the integration object. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a partner integration model entity along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String sensorPartnerId, String integrationId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), sensorPartnerId, integrationId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Gets a partner integration model entity. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     integrationId: String (Optional)
-     *     partyId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param integrationId Id of the integration object. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a partner integration model entity along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String sensorPartnerId, String integrationId, - RequestOptions requestOptions) { - return getWithResponseAsync(sensorPartnerId, integrationId, requestOptions).block(); - } - - /** - * Deletes a partner integration model entity. - * - * @param sensorPartnerId Id of the sensor partner. - * @param integrationId Id of the integration to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String sensorPartnerId, String integrationId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), sensorPartnerId, integrationId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a partner integration model entity. - * - * @param sensorPartnerId Id of the sensor partner. - * @param integrationId Id of the integration to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String sensorPartnerId, String integrationId, - RequestOptions requestOptions) { - return deleteWithResponseAsync(sensorPartnerId, integrationId, requestOptions).block(); - } - - /** - * Checks consent for partner integration. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     consented: Boolean (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     integrationId: String (Optional)
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param integrationId Id of the integration object. - * @param key Partner integration key. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensor partner integration check consent response along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkConsentWithResponseAsync(String sensorPartnerId, String integrationId, - String key, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.checkConsent(this.client.getEndpoint(), sensorPartnerId, - integrationId, key, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Checks consent for partner integration. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     consented: Boolean (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     integrationId: String (Optional)
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param integrationId Id of the integration object. - * @param key Partner integration key. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensor partner integration check consent response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkConsentWithResponse(String sensorPartnerId, String integrationId, String key, - RequestOptions requestOptions) { - return checkConsentWithResponseAsync(sensorPartnerId, integrationId, key, requestOptions).block(); - } - - /** - * Generates partner integration consent link. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     consentLink: String (Optional)
-     *     consentExpiryDateTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param integrationId Id of the integration object. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensor partner integration generate consent link response along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> generateConsentLinkWithResponseAsync(String sensorPartnerId, String integrationId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.generateConsentLink(this.client.getEndpoint(), sensorPartnerId, - integrationId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Generates partner integration consent link. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     consentLink: String (Optional)
-     *     consentExpiryDateTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param integrationId Id of the integration object. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensor partner integration generate consent link response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response generateConsentLinkWithResponse(String sensorPartnerId, String integrationId, - RequestOptions requestOptions) { - return generateConsentLinkWithResponseAsync(sensorPartnerId, integrationId, requestOptions).block(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     integrationId: String (Optional)
-     *     partyId: String (Optional)
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/SensorsImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/SensorsImpl.java deleted file mode 100644 index 472182f8d8f5..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/SensorsImpl.java +++ /dev/null @@ -1,925 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in Sensors. */ -public final class SensorsImpl { - /** The proxy service used to perform REST calls. */ - private final SensorsService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of SensorsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SensorsImpl(FarmBeatsClientImpl client) { - this.service = RestProxy.create(SensorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientSensors to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientSenso") - public interface SensorsService { - @Get("/sensor-partners/{sensorPartnerId}/sensors") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @PathParam("sensorPartnerId") String sensorPartnerId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Patch("/sensor-partners/{sensorPartnerId}/sensors/{sensorId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("sensorPartnerId") String sensorPartnerId, @PathParam("sensorId") String sensorId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData sensorDetails, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/sensor-partners/{sensorPartnerId}/sensors/{sensorId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @PathParam("sensorPartnerId") String sensorPartnerId, @PathParam("sensorId") String sensorId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/sensor-partners/{sensorPartnerId}/sensors/{sensorId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @PathParam("sensorPartnerId") String sensorPartnerId, @PathParam("sensorId") String sensorId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/sensor-partners/{sensorPartnerId}/sensors/{sensorId}/connection-strings") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getConnectionString(@HostParam("endpoint") String endpoint, - @PathParam("sensorPartnerId") String sensorPartnerId, @PathParam("sensorId") String sensorId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Post("/sensor-partners/{sensorPartnerId}/sensors/{sensorId}/connection-strings/:renew") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> renewConnectionString(@HostParam("endpoint") String endpoint, - @PathParam("sensorPartnerId") String sensorPartnerId, @PathParam("sensorId") String sensorId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BinaryData renewConnectionStringModel, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of sensor resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
sensorDataModelIdsList<String>NoId's of the sensor data models. Call {@link RequestOptions#addQueryParam} to add string to array.
sensorMappingIdsList<String>NoIds of the sensor mappings. Call {@link RequestOptions#addQueryParam} to add string to array.
deviceIdsList<String>NoId's of the devices. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     hardwareId: String (Optional)
-     *     deviceId: String (Optional)
-     *     type: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     port (Optional): {
-     *         name: String (Optional)
-     *         type: String (Optional)
-     *     }
-     *     depthInMeters (Optional): [
-     *         double (Optional)
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String sensorPartnerId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), sensorPartnerId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of sensor resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
sensorDataModelIdsList<String>NoId's of the sensor data models. Call {@link RequestOptions#addQueryParam} to add string to array.
sensorMappingIdsList<String>NoIds of the sensor mappings. Call {@link RequestOptions#addQueryParam} to add string to array.
deviceIdsList<String>NoId's of the devices. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     hardwareId: String (Optional)
-     *     deviceId: String (Optional)
-     *     type: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     port (Optional): {
-     *         name: String (Optional)
-     *         type: String (Optional)
-     *     }
-     *     depthInMeters (Optional): [
-     *         double (Optional)
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String sensorPartnerId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(sensorPartnerId, requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of sensor resources. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
sensorDataModelIdsList<String>NoId's of the sensor data models. Call {@link RequestOptions#addQueryParam} to add string to array.
sensorMappingIdsList<String>NoIds of the sensor mappings. Call {@link RequestOptions#addQueryParam} to add string to array.
deviceIdsList<String>NoId's of the devices. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     hardwareId: String (Optional)
-     *     deviceId: String (Optional)
-     *     type: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     port (Optional): {
-     *         name: String (Optional)
-     *         type: String (Optional)
-     *     }
-     *     depthInMeters (Optional): [
-     *         double (Optional)
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the associated sensor partner. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String sensorPartnerId, RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(sensorPartnerId, requestOptions)); - } - - /** - * Create a sensor entity. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     sensorDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     hardwareId: String (Optional)
-     *     deviceId: String (Optional)
-     *     type: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     port (Optional): {
-     *         name: String (Optional)
-     *         type: String (Optional)
-     *     }
-     *     depthInMeters (Optional): [
-     *         double (Optional)
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     hardwareId: String (Optional)
-     *     deviceId: String (Optional)
-     *     type: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     port (Optional): {
-     *         name: String (Optional)
-     *         type: String (Optional)
-     *     }
-     *     depthInMeters (Optional): [
-     *         double (Optional)
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorId Id of the sensor resource. - * @param sensorDetails Sensor object details. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensor API model along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String sensorPartnerId, String sensorId, - BinaryData sensorDetails, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), sensorPartnerId, - sensorId, this.client.getServiceVersion().getVersion(), sensorDetails, accept, requestOptions, context)); - } - - /** - * Create a sensor entity. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     sensorDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     hardwareId: String (Optional)
-     *     deviceId: String (Optional)
-     *     type: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     port (Optional): {
-     *         name: String (Optional)
-     *         type: String (Optional)
-     *     }
-     *     depthInMeters (Optional): [
-     *         double (Optional)
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     hardwareId: String (Optional)
-     *     deviceId: String (Optional)
-     *     type: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     port (Optional): {
-     *         name: String (Optional)
-     *         type: String (Optional)
-     *     }
-     *     depthInMeters (Optional): [
-     *         double (Optional)
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorId Id of the sensor resource. - * @param sensorDetails Sensor object details. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sensor API model along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String sensorPartnerId, String sensorId, - BinaryData sensorDetails, RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(sensorPartnerId, sensorId, sensorDetails, requestOptions).block(); - } - - /** - * Gets a sensor entity. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     hardwareId: String (Optional)
-     *     deviceId: String (Optional)
-     *     type: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     port (Optional): {
-     *         name: String (Optional)
-     *         type: String (Optional)
-     *     }
-     *     depthInMeters (Optional): [
-     *         double (Optional)
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorId Id of the sensor resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a sensor entity along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String sensorPartnerId, String sensorId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), sensorPartnerId, sensorId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Gets a sensor entity. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     hardwareId: String (Optional)
-     *     deviceId: String (Optional)
-     *     type: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     port (Optional): {
-     *         name: String (Optional)
-     *         type: String (Optional)
-     *     }
-     *     depthInMeters (Optional): [
-     *         double (Optional)
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorId Id of the sensor resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a sensor entity along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String sensorPartnerId, String sensorId, - RequestOptions requestOptions) { - return getWithResponseAsync(sensorPartnerId, sensorId, requestOptions).block(); - } - - /** - * Deletes a sensor entity. - * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorId Id of the sensor resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String sensorPartnerId, String sensorId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), sensorPartnerId, sensorId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a sensor entity. - * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorId Id of the sensor resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String sensorPartnerId, String sensorId, RequestOptions requestOptions) { - return deleteWithResponseAsync(sensorPartnerId, sensorId, requestOptions).block(); - } - - /** - * Gets a sensor connection string. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     primaryDeviceConnectionString: String (Optional)
-     *     secondaryDeviceConnectionString: String (Optional)
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorId Id of the sensor resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a sensor connection string along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getConnectionStringWithResponseAsync(String sensorPartnerId, String sensorId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getConnectionString(this.client.getEndpoint(), sensorPartnerId, - sensorId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Gets a sensor connection string. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     primaryDeviceConnectionString: String (Optional)
-     *     secondaryDeviceConnectionString: String (Optional)
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorId Id of the sensor resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a sensor connection string along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getConnectionStringWithResponse(String sensorPartnerId, String sensorId, - RequestOptions requestOptions) { - return getConnectionStringWithResponseAsync(sensorPartnerId, sensorId, requestOptions).block(); - } - - /** - * Renews a sensor connection string. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     connectionStringType: String(Primary/Secondary/Both) (Required)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     primaryDeviceConnectionString: String (Optional)
-     *     secondaryDeviceConnectionString: String (Optional)
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorId Id of the sensor resource. - * @param renewConnectionStringModel Sensor's connection string model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return authentication via connection string to IoTHub devices along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> renewConnectionStringWithResponseAsync(String sensorPartnerId, String sensorId, - BinaryData renewConnectionStringModel, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.renewConnectionString(this.client.getEndpoint(), sensorPartnerId, - sensorId, this.client.getServiceVersion().getVersion(), renewConnectionStringModel, accept, requestOptions, - context)); - } - - /** - * Renews a sensor connection string. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     connectionStringType: String(Primary/Secondary/Both) (Required)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     primaryDeviceConnectionString: String (Optional)
-     *     secondaryDeviceConnectionString: String (Optional)
-     * }
-     * }
- * - * @param sensorPartnerId Id of the sensor partner. - * @param sensorId Id of the sensor resource. - * @param renewConnectionStringModel Sensor's connection string model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return authentication via connection string to IoTHub devices along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response renewConnectionStringWithResponse(String sensorPartnerId, String sensorId, - BinaryData renewConnectionStringModel, RequestOptions requestOptions) { - return renewConnectionStringWithResponseAsync(sensorPartnerId, sensorId, renewConnectionStringModel, - requestOptions).block(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     sensorDataModelId: String (Optional)
-     *     integrationId: String (Optional)
-     *     hardwareId: String (Optional)
-     *     deviceId: String (Optional)
-     *     type: String (Optional)
-     *     location (Optional): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     port (Optional): {
-     *         name: String (Optional)
-     *         type: String (Optional)
-     *     }
-     *     depthInMeters (Optional): [
-     *         double (Optional)
-     *     ]
-     *     sensorPartnerId: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     eTag: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/SolutionInferencesImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/SolutionInferencesImpl.java deleted file mode 100644 index 107b3e264f94..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/SolutionInferencesImpl.java +++ /dev/null @@ -1,367 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.DefaultPollingStrategy; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.core.util.serializer.TypeReference; -import java.time.Duration; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SolutionInferences. */ -public final class SolutionInferencesImpl { - /** The proxy service used to perform REST calls. */ - private final SolutionInferencesService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of SolutionInferencesImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SolutionInferencesImpl(FarmBeatsClientImpl client) { - this.service = RestProxy.create(SolutionInferencesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientSolutionInferences to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientSolut") - public interface SolutionInferencesService { - @Post("/solutions/{solutionId}:cancel") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> cancel(@HostParam("endpoint") String endpoint, - @PathParam("solutionId") String solutionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BinaryData solutionInferenceRequest, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Post("/solutions/{solutionId}:create") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("solutionId") String solutionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BinaryData solutionInferenceRequest, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Post("/solutions/{solutionId}:fetch") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> fetch(@HostParam("endpoint") String endpoint, - @PathParam("solutionId") String solutionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BinaryData solutionInferenceRequest, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - } - - /** - * Cancels a job for given solution id. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     requestPath: String (Required)
-     *     partnerRequestBody (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     String: Object (Required)
-     * }
-     * }
- * - * @param solutionId Id of solution for which job is to be cancelled. - * @param solutionInferenceRequest solutionInferenceRequest containing input needed for job request processing. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return dictionary of <any> along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> cancelWithResponseAsync(String solutionId, BinaryData solutionInferenceRequest, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.cancel(this.client.getEndpoint(), solutionId, - this.client.getServiceVersion().getVersion(), solutionInferenceRequest, accept, requestOptions, context)); - } - - /** - * Cancels a job for given solution id. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     requestPath: String (Required)
-     *     partnerRequestBody (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     String: Object (Required)
-     * }
-     * }
- * - * @param solutionId Id of solution for which job is to be cancelled. - * @param solutionInferenceRequest solutionInferenceRequest containing input needed for job request processing. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return dictionary of <any> along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelWithResponse(String solutionId, BinaryData solutionInferenceRequest, - RequestOptions requestOptions) { - return cancelWithResponseAsync(solutionId, solutionInferenceRequest, requestOptions).block(); - } - - /** - * Creates a job trigger for a solution. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     requestPath: String (Required)
-     *     partnerRequestBody (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     String: Object (Required)
-     * }
-     * }
- * - * @param solutionId Id of the solution resource. - * @param solutionInferenceRequest solutionInferenceRequest containing input needed for job request processing. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return dictionary of <any> along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String solutionId, - BinaryData solutionInferenceRequest, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), solutionId, - this.client.getServiceVersion().getVersion(), solutionInferenceRequest, accept, requestOptions, context)); - } - - /** - * Creates a job trigger for a solution. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     requestPath: String (Required)
-     *     partnerRequestBody (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     String: Object (Required)
-     * }
-     * }
- * - * @param solutionId Id of the solution resource. - * @param solutionInferenceRequest solutionInferenceRequest containing input needed for job request processing. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of dictionary of <any>. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateOrUpdateAsync(String solutionId, - BinaryData solutionInferenceRequest, RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createOrUpdateWithResponseAsync(solutionId, solutionInferenceRequest, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Creates a job trigger for a solution. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     requestPath: String (Required)
-     *     partnerRequestBody (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     String: Object (Required)
-     * }
-     * }
- * - * @param solutionId Id of the solution resource. - * @param solutionInferenceRequest solutionInferenceRequest containing input needed for job request processing. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of dictionary of <any>. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateOrUpdate(String solutionId, - BinaryData solutionInferenceRequest, RequestOptions requestOptions) { - return this.beginCreateOrUpdateAsync(solutionId, solutionInferenceRequest, requestOptions).getSyncPoller(); - } - - /** - * Fetches details of triggered job for a solution. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     requestPath: String (Required)
-     *     partnerRequestBody (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     String: Object (Required)
-     * }
-     * }
- * - * @param solutionId Id of the solution. - * @param solutionInferenceRequest solutionInferenceRequest containing input needed for job request processing. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return dictionary of <any> along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> fetchWithResponseAsync(String solutionId, BinaryData solutionInferenceRequest, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.fetch(this.client.getEndpoint(), solutionId, - this.client.getServiceVersion().getVersion(), solutionInferenceRequest, accept, requestOptions, context)); - } - - /** - * Fetches details of triggered job for a solution. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     requestPath: String (Required)
-     *     partnerRequestBody (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     String: Object (Required)
-     * }
-     * }
- * - * @param solutionId Id of the solution. - * @param solutionInferenceRequest solutionInferenceRequest containing input needed for job request processing. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return dictionary of <any> along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response fetchWithResponse(String solutionId, BinaryData solutionInferenceRequest, - RequestOptions requestOptions) { - return fetchWithResponseAsync(solutionId, solutionInferenceRequest, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/TillageDatasImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/TillageDatasImpl.java deleted file mode 100644 index 8a89c2fb07f1..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/TillageDatasImpl.java +++ /dev/null @@ -1,1318 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.DefaultPollingStrategy; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.core.util.serializer.TypeReference; -import java.time.Duration; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in TillageDatas. */ -public final class TillageDatasImpl { - /** The proxy service used to perform REST calls. */ - private final TillageDatasService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of TillageDatasImpl. - * - * @param client the instance of the service client containing this operation class. - */ - TillageDatasImpl(FarmBeatsClientImpl client) { - this.service - = RestProxy.create(TillageDatasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientTillageDatas to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientTilla") - public interface TillageDatasService { - @Get("/parties/{partyId}/tillage-data") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyId(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/tillage-data/{tillageDataId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("tillageDataId") String tillageDataId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Patch("/parties/{partyId}/tillage-data/{tillageDataId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @PathParam("tillageDataId") String tillageDataId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData tillageData, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/parties/{partyId}/tillage-data/{tillageDataId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("tillageDataId") String tillageDataId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/tillage-data") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Put("/tillage-data/cascade-delete/{jobId}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createCascadeDeleteJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("partyId") String partyId, - @QueryParam("tillageDataId") String tillageDataId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/tillage-data/cascade-delete/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getCascadeDeleteJobDetails(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyIdNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of tillage data resources under a particular farm. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minTillageDepthDoubleNoMinimum measured tillage depth (inclusive).
maxTillageDepthDoubleNoMaximum measured tillage depth (inclusive).
minTillagePressureDoubleNoMinimum pressure applied to a tillage implement (inclusive).
maxTillagePressureDoubleNoMaximum pressure applied to a tillage implement (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     tillageDepth (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     tillagePressure (Optional): (recursive schema, see tillagePressure above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdSinglePageAsync(String partyId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByPartyId(this.client.getEndpoint(), partyId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of tillage data resources under a particular farm. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minTillageDepthDoubleNoMinimum measured tillage depth (inclusive).
maxTillageDepthDoubleNoMaximum measured tillage depth (inclusive).
minTillagePressureDoubleNoMinimum pressure applied to a tillage implement (inclusive).
maxTillagePressureDoubleNoMaximum pressure applied to a tillage implement (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     tillageDepth (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     tillagePressure (Optional): (recursive schema, see tillagePressure above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyIdAsync(String partyId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listByPartyIdSinglePageAsync(partyId, requestOptions), - nextLink -> listByPartyIdNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of tillage data resources under a particular farm. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minTillageDepthDoubleNoMinimum measured tillage depth (inclusive).
maxTillageDepthDoubleNoMaximum measured tillage depth (inclusive).
minTillagePressureDoubleNoMinimum pressure applied to a tillage implement (inclusive).
maxTillagePressureDoubleNoMaximum pressure applied to a tillage implement (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     tillageDepth (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     tillagePressure (Optional): (recursive schema, see tillagePressure above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(listByPartyIdAsync(partyId, requestOptions)); - } - - /** - * Get a specified tillage data resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     tillageDepth (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     tillagePressure (Optional): (recursive schema, see tillagePressure above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party resource. - * @param tillageDataId ID of the tillage data resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified tillage data resource under a particular party along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String partyId, String tillageDataId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), partyId, tillageDataId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get a specified tillage data resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     tillageDepth (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     tillagePressure (Optional): (recursive schema, see tillagePressure above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party resource. - * @param tillageDataId ID of the tillage data resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified tillage data resource under a particular party along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String tillageDataId, RequestOptions requestOptions) { - return getWithResponseAsync(partyId, tillageDataId, requestOptions).block(); - } - - /** - * Creates or updates an tillage data resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     tillageDepth (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     tillagePressure (Optional): (recursive schema, see tillagePressure above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     tillageDepth (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     tillagePressure (Optional): (recursive schema, see tillagePressure above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param tillageDataId ID of the tillage data resource. - * @param tillageData Tillage data resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of tillage data resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String partyId, String tillageDataId, - BinaryData tillageData, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), partyId, tillageDataId, - this.client.getServiceVersion().getVersion(), tillageData, accept, requestOptions, context)); - } - - /** - * Creates or updates an tillage data resource under a particular party. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     tillageDepth (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     tillagePressure (Optional): (recursive schema, see tillagePressure above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     tillageDepth (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     tillagePressure (Optional): (recursive schema, see tillagePressure above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId ID of the associated party. - * @param tillageDataId ID of the tillage data resource. - * @param tillageData Tillage data resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of tillage data resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String tillageDataId, BinaryData tillageData, - RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(partyId, tillageDataId, tillageData, requestOptions).block(); - } - - /** - * Deletes a specified tillage data resource under a particular party. - * - * @param partyId ID of the associated party resource. - * @param tillageDataId ID of the tillage data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String partyId, String tillageDataId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), partyId, tillageDataId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a specified tillage data resource under a particular party. - * - * @param partyId ID of the associated party resource. - * @param tillageDataId ID of the tillage data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String tillageDataId, RequestOptions requestOptions) { - return deleteWithResponseAsync(partyId, tillageDataId, requestOptions).block(); - } - - /** - * Returns a paginated list of tillage data resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minTillageDepthDoubleNoMinimum measured tillage depth (inclusive).
maxTillageDepthDoubleNoMaximum measured tillage depth (inclusive).
minTillagePressureDoubleNoMinimum pressure applied to a tillage implement (inclusive).
maxTillagePressureDoubleNoMaximum pressure applied to a tillage implement (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     tillageDepth (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     tillagePressure (Optional): (recursive schema, see tillagePressure above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of tillage data resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minTillageDepthDoubleNoMinimum measured tillage depth (inclusive).
maxTillageDepthDoubleNoMaximum measured tillage depth (inclusive).
minTillagePressureDoubleNoMinimum pressure applied to a tillage implement (inclusive).
maxTillagePressureDoubleNoMaximum pressure applied to a tillage implement (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     tillageDepth (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     tillagePressure (Optional): (recursive schema, see tillagePressure above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of tillage data resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
minTillageDepthDoubleNoMinimum measured tillage depth (inclusive).
maxTillageDepthDoubleNoMaximum measured tillage depth (inclusive).
minTillagePressureDoubleNoMinimum pressure applied to a tillage implement (inclusive).
maxTillagePressureDoubleNoMaximum pressure applied to a tillage implement (inclusive).
sourcesList<String>NoSources of the operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
associatedBoundaryIdsList<String>NoBoundary IDs associated with operation data. Call {@link RequestOptions#addQueryParam} to add string to array.
minOperationStartDateTimeOffsetDateTimeNoMinimum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationStartDateTimeOffsetDateTimeNoMaximum start date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationEndDateTimeOffsetDateTimeNoMinimum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationEndDateTimeOffsetDateTimeNoMaximum end date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minOperationModifiedDateTimeOffsetDateTimeNoMinimum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
maxOperationModifiedDateTimeOffsetDateTimeNoMaximum modified date-time of the operation data, sample format: yyyy-MM-ddTHH:mm:ssZ (inclusive).
minAreaDoubleNoMinimum area for which operation was applied (inclusive).
maxAreaDoubleNoMaximum area for which operation was applied (inclusive).
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     tillageDepth (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     tillagePressure (Optional): (recursive schema, see tillagePressure above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(requestOptions)); - } - - /** - * Create cascade delete job for tillage data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param partyId Id of the party. - * @param tillageDataId Id of the tillage data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of cascade delete job along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createCascadeDeleteJobWithResponseAsync(String jobId, String partyId, - String tillageDataId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createCascadeDeleteJob(this.client.getEndpoint(), jobId, partyId, - tillageDataId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Create cascade delete job for tillage data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param partyId Id of the party. - * @param tillageDataId Id of the tillage data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJobAsync(String jobId, String partyId, - String tillageDataId, RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createCascadeDeleteJobWithResponseAsync(jobId, partyId, tillageDataId, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Create cascade delete job for tillage data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param partyId Id of the party. - * @param tillageDataId Id of the tillage data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, - String tillageDataId, RequestOptions requestOptions) { - return this.beginCreateCascadeDeleteJobAsync(jobId, partyId, tillageDataId, requestOptions).getSyncPoller(); - } - - /** - * Get cascade delete job for tillage data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for tillage data resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponseAsync(String jobId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getCascadeDeleteJobDetails(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get cascade delete job for tillage data resource. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cascade delete job for tillage data resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions).block(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     tillageDepth (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     tillagePressure (Optional): (recursive schema, see tillagePressure above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listByPartyIdNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     tillageDepth (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     tillagePressure (Optional): (recursive schema, see tillagePressure above)
-     *     area (Optional): (recursive schema, see area above)
-     *     operationModifiedDateTime: OffsetDateTime (Optional)
-     *     operationStartDateTime: OffsetDateTime (Optional)
-     *     operationEndDateTime: OffsetDateTime (Optional)
-     *     attachmentsLink: String (Optional)
-     *     associatedBoundaryId: String (Optional)
-     *     partyId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/WeatherDatasImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/WeatherDatasImpl.java deleted file mode 100644 index 3065721a68f3..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/WeatherDatasImpl.java +++ /dev/null @@ -1,359 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in WeatherDatas. */ -public final class WeatherDatasImpl { - /** The proxy service used to perform REST calls. */ - private final WeatherDatasService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of WeatherDatasImpl. - * - * @param client the instance of the service client containing this operation class. - */ - WeatherDatasImpl(FarmBeatsClientImpl client) { - this.service - = RestProxy.create(WeatherDatasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientWeatherDatas to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientWeath") - public interface WeatherDatasService { - @Post("/weather-data/:fetch") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BinaryData weatherDataProviderRequest, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - } - - /** - * Returns a list of WeatherData. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     locations (Optional): [
-     *          (Optional){
-     *             type: String(LatLong/IataCode/IcaoCode/PlaceId/PostalKey) (Required)
-     *             value: String (Required)
-     *         }
-     *     ]
-     *     providerAppId: String (Optional)
-     *     providerApiKey: String (Required)
-     *     extensionId: String (Required)
-     *     extensionApiName: String (Required)
-     *     language: String (Optional)
-     *     startTimeHours: Integer (Optional)
-     *     endTimeHours: Integer (Optional)
-     *     duration: Integer (Optional)
-     *     units: String (Required)
-     *     additionalParams (Optional): {
-     *         iconResolution: String (Optional)
-     *         details: Boolean (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     weatherMetadata (Required): {
-     *         extensionVersion: String (Required)
-     *         weatherDataType: String (Required)
-     *         extensionId: String (Required)
-     *         extensionApiName: String (Required)
-     *         language: String (Optional)
-     *         startTimeHours: Integer (Optional)
-     *         endTimeHours: Integer (Optional)
-     *         duration: Integer (Optional)
-     *         units: String (Required)
-     *         additionalParams (Optional): {
-     *             iconResolution: String (Optional)
-     *             details: Boolean (Optional)
-     *         }
-     *     }
-     *     status: String(Succeeded/Failed/PartiallySucceeded) (Optional)
-     *     locations (Optional): [
-     *          (Optional){
-     *             location (Optional): {
-     *                 type: String(LatLong/IataCode/IcaoCode/PlaceId/PostalKey) (Required)
-     *                 value: String (Required)
-     *             }
-     *             requestCompletionTime: String (Optional)
-     *             lastRefreshedDateTime: OffsetDateTime (Optional)
-     *             data (Optional): {
-     *                 wetBulbTemperature (Optional): {
-     *                     unit: String (Optional)
-     *                     values (Optional): [
-     *                         double (Optional)
-     *                     ]
-     *                 }
-     *                 cloudCover (Optional): (recursive schema, see cloudCover above)
-     *                 dayOfWeek (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 dayOrNight (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 expirationTime (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 iconCode (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 iconCodeExtend (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 hasPrecipitation (Optional): [
-     *                     boolean (Optional)
-     *                 ]
-     *                 pressureMeanSeaLevel (Optional): (recursive schema, see pressureMeanSeaLevel above)
-     *                 relativeHumidity (Optional): (recursive schema, see relativeHumidity above)
-     *                 temperature (Optional): (recursive schema, see temperature above)
-     *                 temperatureDewPoint (Optional): (recursive schema, see temperatureDewPoint above)
-     *                 temperatureFeelsLike (Optional): (recursive schema, see temperatureFeelsLike above)
-     *                 temperatureHeatIndex (Optional): (recursive schema, see temperatureHeatIndex above)
-     *                 temperatureWindChill (Optional): (recursive schema, see temperatureWindChill above)
-     *                 uvDescription (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 uvIndex (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 validTimeLocal (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 validTime (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 visibility (Optional): (recursive schema, see visibility above)
-     *                 windDirection (Optional): (recursive schema, see windDirection above)
-     *                 windGust (Optional): (recursive schema, see windGust above)
-     *                 windSpeed (Optional): (recursive schema, see windSpeed above)
-     *                 wxPhraseLong (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 wxPhraseShort (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 additionalAttributes (Optional): {
-     *                     String: Object (Optional)
-     *                 }
-     *             }
-     *         }
-     *     ]
-     *     errors (Optional): {
-     *         locations (Optional): [
-     *              (Optional){
-     *                 location (Optional): (recursive schema, see location above)
-     *                 code: Integer (Optional)
-     *                 description: String (Optional)
-     *                 retryable: Boolean (Optional)
-     *             }
-     *         ]
-     *     }
-     * }
-     * }
- * - * @param weatherDataProviderRequest Weather data provider request. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of Weather Data Provider Response along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(BinaryData weatherDataProviderRequest, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), weatherDataProviderRequest, accept, requestOptions, context)); - } - - /** - * Returns a list of WeatherData. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     locations (Optional): [
-     *          (Optional){
-     *             type: String(LatLong/IataCode/IcaoCode/PlaceId/PostalKey) (Required)
-     *             value: String (Required)
-     *         }
-     *     ]
-     *     providerAppId: String (Optional)
-     *     providerApiKey: String (Required)
-     *     extensionId: String (Required)
-     *     extensionApiName: String (Required)
-     *     language: String (Optional)
-     *     startTimeHours: Integer (Optional)
-     *     endTimeHours: Integer (Optional)
-     *     duration: Integer (Optional)
-     *     units: String (Required)
-     *     additionalParams (Optional): {
-     *         iconResolution: String (Optional)
-     *         details: Boolean (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     weatherMetadata (Required): {
-     *         extensionVersion: String (Required)
-     *         weatherDataType: String (Required)
-     *         extensionId: String (Required)
-     *         extensionApiName: String (Required)
-     *         language: String (Optional)
-     *         startTimeHours: Integer (Optional)
-     *         endTimeHours: Integer (Optional)
-     *         duration: Integer (Optional)
-     *         units: String (Required)
-     *         additionalParams (Optional): {
-     *             iconResolution: String (Optional)
-     *             details: Boolean (Optional)
-     *         }
-     *     }
-     *     status: String(Succeeded/Failed/PartiallySucceeded) (Optional)
-     *     locations (Optional): [
-     *          (Optional){
-     *             location (Optional): {
-     *                 type: String(LatLong/IataCode/IcaoCode/PlaceId/PostalKey) (Required)
-     *                 value: String (Required)
-     *             }
-     *             requestCompletionTime: String (Optional)
-     *             lastRefreshedDateTime: OffsetDateTime (Optional)
-     *             data (Optional): {
-     *                 wetBulbTemperature (Optional): {
-     *                     unit: String (Optional)
-     *                     values (Optional): [
-     *                         double (Optional)
-     *                     ]
-     *                 }
-     *                 cloudCover (Optional): (recursive schema, see cloudCover above)
-     *                 dayOfWeek (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 dayOrNight (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 expirationTime (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 iconCode (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 iconCodeExtend (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 hasPrecipitation (Optional): [
-     *                     boolean (Optional)
-     *                 ]
-     *                 pressureMeanSeaLevel (Optional): (recursive schema, see pressureMeanSeaLevel above)
-     *                 relativeHumidity (Optional): (recursive schema, see relativeHumidity above)
-     *                 temperature (Optional): (recursive schema, see temperature above)
-     *                 temperatureDewPoint (Optional): (recursive schema, see temperatureDewPoint above)
-     *                 temperatureFeelsLike (Optional): (recursive schema, see temperatureFeelsLike above)
-     *                 temperatureHeatIndex (Optional): (recursive schema, see temperatureHeatIndex above)
-     *                 temperatureWindChill (Optional): (recursive schema, see temperatureWindChill above)
-     *                 uvDescription (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 uvIndex (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 validTimeLocal (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 validTime (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 visibility (Optional): (recursive schema, see visibility above)
-     *                 windDirection (Optional): (recursive schema, see windDirection above)
-     *                 windGust (Optional): (recursive schema, see windGust above)
-     *                 windSpeed (Optional): (recursive schema, see windSpeed above)
-     *                 wxPhraseLong (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 wxPhraseShort (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 additionalAttributes (Optional): {
-     *                     String: Object (Optional)
-     *                 }
-     *             }
-     *         }
-     *     ]
-     *     errors (Optional): {
-     *         locations (Optional): [
-     *              (Optional){
-     *                 location (Optional): (recursive schema, see location above)
-     *                 code: Integer (Optional)
-     *                 description: String (Optional)
-     *                 retryable: Boolean (Optional)
-     *             }
-     *         ]
-     *     }
-     * }
-     * }
- * - * @param weatherDataProviderRequest Weather data provider request. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of Weather Data Provider Response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(BinaryData weatherDataProviderRequest, RequestOptions requestOptions) { - return getWithResponseAsync(weatherDataProviderRequest, requestOptions).block(); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/WeathersImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/WeathersImpl.java deleted file mode 100644 index ddc9774295bd..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/WeathersImpl.java +++ /dev/null @@ -1,1163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.DefaultPollingStrategy; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.core.util.serializer.TypeReference; -import java.time.Duration; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in Weathers. */ -public final class WeathersImpl { - /** The proxy service used to perform REST calls. */ - private final WeathersService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of WeathersImpl. - * - * @param client the instance of the service client containing this operation class. - */ - WeathersImpl(FarmBeatsClientImpl client) { - this.service = RestProxy.create(WeathersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientWeathers to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientWeath") - public interface WeathersService { - @Get("/weather") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("partyId") String partyId, - @QueryParam("boundaryId") String boundaryId, @QueryParam("extensionId") String extensionId, - @QueryParam("weatherDataType") String weatherDataType, @QueryParam("granularity") String granularity, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/weather/delete-data/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDataDeleteJobDetails(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Put("/weather/delete-data/{jobId}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createDataDeleteJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BinaryData job, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/weather/ingest-data/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDataIngestionJobDetails(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Put("/weather/ingest-data/{jobId}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createDataIngestionJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BinaryData job, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of weather data. - * - *

Query Parameters - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
startDateTimeOffsetDateTimeNoWeather data start UTC date-time (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
endDateTimeOffsetDateTimeNoWeather data end UTC date-time (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     extensionId: String (Required)
-     *     location (Required): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     dateTime: OffsetDateTime (Required)
-     *     unitSystemCode: String (Optional)
-     *     extensionVersion: String (Required)
-     *     weatherDataType: String (Required)
-     *     granularity: String (Required)
-     *     cloudCover (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     dewPoint (Optional): (recursive schema, see dewPoint above)
-     *     growingDegreeDay (Optional): (recursive schema, see growingDegreeDay above)
-     *     precipitation (Optional): (recursive schema, see precipitation above)
-     *     pressure (Optional): (recursive schema, see pressure above)
-     *     relativeHumidity (Optional): (recursive schema, see relativeHumidity above)
-     *     soilMoisture (Optional): (recursive schema, see soilMoisture above)
-     *     soilTemperature (Optional): (recursive schema, see soilTemperature above)
-     *     temperature (Optional): (recursive schema, see temperature above)
-     *     visibility (Optional): (recursive schema, see visibility above)
-     *     wetBulbTemperature (Optional): (recursive schema, see wetBulbTemperature above)
-     *     windChill (Optional): (recursive schema, see windChill above)
-     *     windDirection (Optional): (recursive schema, see windDirection above)
-     *     windGust (Optional): (recursive schema, see windGust above)
-     *     windSpeed (Optional): (recursive schema, see windSpeed above)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Party ID. - * @param boundaryId Boundary ID. - * @param extensionId ID of the weather extension. - * @param weatherDataType Type of weather data (forecast/historical). - * @param granularity Granularity of weather data (daily/hourly). - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String partyId, String boundaryId, String extensionId, - String weatherDataType, String granularity, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), partyId, boundaryId, extensionId, weatherDataType, - granularity, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of weather data. - * - *

Query Parameters - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
startDateTimeOffsetDateTimeNoWeather data start UTC date-time (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
endDateTimeOffsetDateTimeNoWeather data end UTC date-time (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     extensionId: String (Required)
-     *     location (Required): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     dateTime: OffsetDateTime (Required)
-     *     unitSystemCode: String (Optional)
-     *     extensionVersion: String (Required)
-     *     weatherDataType: String (Required)
-     *     granularity: String (Required)
-     *     cloudCover (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     dewPoint (Optional): (recursive schema, see dewPoint above)
-     *     growingDegreeDay (Optional): (recursive schema, see growingDegreeDay above)
-     *     precipitation (Optional): (recursive schema, see precipitation above)
-     *     pressure (Optional): (recursive schema, see pressure above)
-     *     relativeHumidity (Optional): (recursive schema, see relativeHumidity above)
-     *     soilMoisture (Optional): (recursive schema, see soilMoisture above)
-     *     soilTemperature (Optional): (recursive schema, see soilTemperature above)
-     *     temperature (Optional): (recursive schema, see temperature above)
-     *     visibility (Optional): (recursive schema, see visibility above)
-     *     wetBulbTemperature (Optional): (recursive schema, see wetBulbTemperature above)
-     *     windChill (Optional): (recursive schema, see windChill above)
-     *     windDirection (Optional): (recursive schema, see windDirection above)
-     *     windGust (Optional): (recursive schema, see windGust above)
-     *     windSpeed (Optional): (recursive schema, see windSpeed above)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Party ID. - * @param boundaryId Boundary ID. - * @param extensionId ID of the weather extension. - * @param weatherDataType Type of weather data (forecast/historical). - * @param granularity Granularity of weather data (daily/hourly). - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String partyId, String boundaryId, String extensionId, - String weatherDataType, String granularity, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>( - () -> listSinglePageAsync(partyId, boundaryId, extensionId, weatherDataType, granularity, requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of weather data. - * - *

Query Parameters - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
startDateTimeOffsetDateTimeNoWeather data start UTC date-time (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
endDateTimeOffsetDateTimeNoWeather data end UTC date-time (inclusive), sample format: yyyy-MM-ddTHH:mm:ssZ.
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     extensionId: String (Required)
-     *     location (Required): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     dateTime: OffsetDateTime (Required)
-     *     unitSystemCode: String (Optional)
-     *     extensionVersion: String (Required)
-     *     weatherDataType: String (Required)
-     *     granularity: String (Required)
-     *     cloudCover (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     dewPoint (Optional): (recursive schema, see dewPoint above)
-     *     growingDegreeDay (Optional): (recursive schema, see growingDegreeDay above)
-     *     precipitation (Optional): (recursive schema, see precipitation above)
-     *     pressure (Optional): (recursive schema, see pressure above)
-     *     relativeHumidity (Optional): (recursive schema, see relativeHumidity above)
-     *     soilMoisture (Optional): (recursive schema, see soilMoisture above)
-     *     soilTemperature (Optional): (recursive schema, see soilTemperature above)
-     *     temperature (Optional): (recursive schema, see temperature above)
-     *     visibility (Optional): (recursive schema, see visibility above)
-     *     wetBulbTemperature (Optional): (recursive schema, see wetBulbTemperature above)
-     *     windChill (Optional): (recursive schema, see windChill above)
-     *     windDirection (Optional): (recursive schema, see windDirection above)
-     *     windGust (Optional): (recursive schema, see windGust above)
-     *     windSpeed (Optional): (recursive schema, see windSpeed above)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Party ID. - * @param boundaryId Boundary ID. - * @param extensionId ID of the weather extension. - * @param weatherDataType Type of weather data (forecast/historical). - * @param granularity Granularity of weather data (daily/hourly). - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String partyId, String boundaryId, String extensionId, String weatherDataType, - String granularity, RequestOptions requestOptions) { - return new PagedIterable<>( - listAsync(partyId, boundaryId, extensionId, weatherDataType, granularity, requestOptions)); - } - - /** - * Get weather data delete job. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     extensionId: String (Required)
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     weatherDataType: String (Optional)
-     *     granularity: String (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return weather data delete job along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDataDeleteJobDetailsWithResponseAsync(String jobId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDataDeleteJobDetails(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get weather data delete job. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     extensionId: String (Required)
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     weatherDataType: String (Optional)
-     *     granularity: String (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return weather data delete job along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDataDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return getDataDeleteJobDetailsWithResponseAsync(jobId, requestOptions).block(); - } - - /** - * Create a weather data delete job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     extensionId: String (Required)
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     weatherDataType: String (Optional)
-     *     granularity: String (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     extensionId: String (Required)
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     weatherDataType: String (Optional)
-     *     granularity: String (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of weather data delete job along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createDataDeleteJobWithResponseAsync(String jobId, BinaryData job, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createDataDeleteJob(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), job, accept, requestOptions, context)); - } - - /** - * Create a weather data delete job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     extensionId: String (Required)
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     weatherDataType: String (Optional)
-     *     granularity: String (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     extensionId: String (Required)
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     weatherDataType: String (Optional)
-     *     granularity: String (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of weather data delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateDataDeleteJobAsync(String jobId, BinaryData job, - RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createDataDeleteJobWithResponseAsync(jobId, job, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Create a weather data delete job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     extensionId: String (Required)
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     weatherDataType: String (Optional)
-     *     granularity: String (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     extensionId: String (Required)
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     weatherDataType: String (Optional)
-     *     granularity: String (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Job Id supplied by end user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of weather data delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateDataDeleteJob(String jobId, BinaryData job, - RequestOptions requestOptions) { - return this.beginCreateDataDeleteJobAsync(jobId, job, requestOptions).getSyncPoller(); - } - - /** - * Get weather ingestion job. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     boundaryId: String (Required)
-     *     partyId: String (Required)
-     *     extensionId: String (Required)
-     *     extensionApiName: String (Required)
-     *     extensionApiInput (Required): {
-     *         String: Object (Required)
-     *     }
-     *     extensionDataProviderAppId: String (Optional)
-     *     extensionDataProviderApiKey: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return weather ingestion job along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDataIngestionJobDetailsWithResponseAsync(String jobId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDataIngestionJobDetails(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get weather ingestion job. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     boundaryId: String (Required)
-     *     partyId: String (Required)
-     *     extensionId: String (Required)
-     *     extensionApiName: String (Required)
-     *     extensionApiInput (Required): {
-     *         String: Object (Required)
-     *     }
-     *     extensionDataProviderAppId: String (Optional)
-     *     extensionDataProviderApiKey: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return weather ingestion job along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDataIngestionJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return getDataIngestionJobDetailsWithResponseAsync(jobId, requestOptions).block(); - } - - /** - * Create a weather data ingestion job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     boundaryId: String (Required)
-     *     partyId: String (Required)
-     *     extensionId: String (Required)
-     *     extensionApiName: String (Required)
-     *     extensionApiInput (Required): {
-     *         String: Object (Required)
-     *     }
-     *     extensionDataProviderAppId: String (Optional)
-     *     extensionDataProviderApiKey: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     boundaryId: String (Required)
-     *     partyId: String (Required)
-     *     extensionId: String (Required)
-     *     extensionApiName: String (Required)
-     *     extensionApiInput (Required): {
-     *         String: Object (Required)
-     *     }
-     *     extensionDataProviderAppId: String (Optional)
-     *     extensionDataProviderApiKey: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Job id supplied by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of weather ingestion job along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createDataIngestionJobWithResponseAsync(String jobId, BinaryData job, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createDataIngestionJob(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), job, accept, requestOptions, context)); - } - - /** - * Create a weather data ingestion job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     boundaryId: String (Required)
-     *     partyId: String (Required)
-     *     extensionId: String (Required)
-     *     extensionApiName: String (Required)
-     *     extensionApiInput (Required): {
-     *         String: Object (Required)
-     *     }
-     *     extensionDataProviderAppId: String (Optional)
-     *     extensionDataProviderApiKey: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     boundaryId: String (Required)
-     *     partyId: String (Required)
-     *     extensionId: String (Required)
-     *     extensionApiName: String (Required)
-     *     extensionApiInput (Required): {
-     *         String: Object (Required)
-     *     }
-     *     extensionDataProviderAppId: String (Optional)
-     *     extensionDataProviderApiKey: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Job id supplied by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of weather ingestion job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateDataIngestionJobAsync(String jobId, BinaryData job, - RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createDataIngestionJobWithResponseAsync(jobId, job, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Create a weather data ingestion job. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     boundaryId: String (Required)
-     *     partyId: String (Required)
-     *     extensionId: String (Required)
-     *     extensionApiName: String (Required)
-     *     extensionApiInput (Required): {
-     *         String: Object (Required)
-     *     }
-     *     extensionDataProviderAppId: String (Optional)
-     *     extensionDataProviderApiKey: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     boundaryId: String (Required)
-     *     partyId: String (Required)
-     *     extensionId: String (Required)
-     *     extensionApiName: String (Required)
-     *     extensionApiInput (Required): {
-     *         String: Object (Required)
-     *     }
-     *     extensionDataProviderAppId: String (Optional)
-     *     extensionDataProviderApiKey: String (Optional)
-     *     id: String (Optional)
-     *     status: String (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param jobId Job id supplied by user. - * @param job Job parameters supplied by user. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of weather ingestion job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateDataIngestionJob(String jobId, BinaryData job, - RequestOptions requestOptions) { - return this.beginCreateDataIngestionJobAsync(jobId, job, requestOptions).getSyncPoller(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     boundaryId: String (Required)
-     *     extensionId: String (Required)
-     *     location (Required): {
-     *         latitude: double (Required)
-     *         longitude: double (Required)
-     *     }
-     *     dateTime: OffsetDateTime (Required)
-     *     unitSystemCode: String (Optional)
-     *     extensionVersion: String (Required)
-     *     weatherDataType: String (Required)
-     *     granularity: String (Required)
-     *     cloudCover (Optional): {
-     *         unit: String (Optional)
-     *         value: Double (Optional)
-     *     }
-     *     dewPoint (Optional): (recursive schema, see dewPoint above)
-     *     growingDegreeDay (Optional): (recursive schema, see growingDegreeDay above)
-     *     precipitation (Optional): (recursive schema, see precipitation above)
-     *     pressure (Optional): (recursive schema, see pressure above)
-     *     relativeHumidity (Optional): (recursive schema, see relativeHumidity above)
-     *     soilMoisture (Optional): (recursive schema, see soilMoisture above)
-     *     soilTemperature (Optional): (recursive schema, see soilTemperature above)
-     *     temperature (Optional): (recursive schema, see temperature above)
-     *     visibility (Optional): (recursive schema, see visibility above)
-     *     wetBulbTemperature (Optional): (recursive schema, see wetBulbTemperature above)
-     *     windChill (Optional): (recursive schema, see windChill above)
-     *     windDirection (Optional): (recursive schema, see windDirection above)
-     *     windGust (Optional): (recursive schema, see windGust above)
-     *     windSpeed (Optional): (recursive schema, see windSpeed above)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/ZonesImpl.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/ZonesImpl.java deleted file mode 100644 index 4b4f2bf9819e..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/ZonesImpl.java +++ /dev/null @@ -1,1123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.verticals.agrifood.farming.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.DefaultPollingStrategy; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.core.util.serializer.TypeReference; -import java.time.Duration; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in Zones. */ -public final class ZonesImpl { - /** The proxy service used to perform REST calls. */ - private final ZonesService service; - - /** The service client containing this operation class. */ - private final FarmBeatsClientImpl client; - - /** - * Initializes an instance of ZonesImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ZonesImpl(FarmBeatsClientImpl client) { - this.service = RestProxy.create(ZonesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FarmBeatsClientZones to be used by the proxy service to perform REST - * calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "FarmBeatsClientZones") - public interface ZonesService { - @Get("/parties/{partyId}/zones") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyId(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/parties/{partyId}/zones/{zoneId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("zoneId") String zoneId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Patch("/parties/{partyId}/zones/{zoneId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @PathParam("partyId") String partyId, @PathParam("zoneId") String zoneId, - @QueryParam("api-version") String apiVersion, @BodyParam("application/merge-patch+json") BinaryData zone, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Delete("/parties/{partyId}/zones/{zoneId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("partyId") String partyId, - @PathParam("zoneId") String zoneId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/zones") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/zones/cascade-delete/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getCascadeDeleteJobDetails(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Put("/zones/cascade-delete/{jobId}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createCascadeDeleteJob(@HostParam("endpoint") String endpoint, - @PathParam("jobId") String jobId, @QueryParam("partyId") String partyId, - @QueryParam("zoneId") String zoneId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listByPartyIdNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Returns a paginated list of zone resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
managementZoneIdsList<String>NoManagementZoneIds of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     managementZoneId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdSinglePageAsync(String partyId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByPartyId(this.client.getEndpoint(), partyId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of zone resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
managementZoneIdsList<String>NoManagementZoneIds of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     managementZoneId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPartyIdAsync(String partyId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listByPartyIdSinglePageAsync(partyId, requestOptions), - nextLink -> listByPartyIdNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of zone resources under a particular party. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
managementZoneIdsList<String>NoManagementZoneIds of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     managementZoneId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPartyId(String partyId, RequestOptions requestOptions) { - return new PagedIterable<>(listByPartyIdAsync(partyId, requestOptions)); - } - - /** - * Gets a specified zone resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     managementZoneId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param zoneId Id of the zone. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified zone resource under a particular party along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String partyId, String zoneId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), partyId, zoneId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Gets a specified zone resource under a particular party. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     managementZoneId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the associated party. - * @param zoneId Id of the zone. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specified zone resource under a particular party along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String partyId, String zoneId, RequestOptions requestOptions) { - return getWithResponseAsync(partyId, zoneId, requestOptions).block(); - } - - /** - * Creates or updates a Zone resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     managementZoneId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     managementZoneId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party resource. - * @param zoneId Id of the zone resource. - * @param zone Zone resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return api Model for Zone object along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String partyId, String zoneId, BinaryData zone, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), partyId, zoneId, - this.client.getServiceVersion().getVersion(), zone, accept, requestOptions, context)); - } - - /** - * Creates or updates a Zone resource. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     managementZoneId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     managementZoneId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param partyId Id of the party resource. - * @param zoneId Id of the zone resource. - * @param zone Zone resource payload to create or update. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return api Model for Zone object along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String partyId, String zoneId, BinaryData zone, - RequestOptions requestOptions) { - return createOrUpdateWithResponseAsync(partyId, zoneId, zone, requestOptions).block(); - } - - /** - * Deletes a specified zone resource under a particular party. - * - * @param partyId Id of the party. - * @param zoneId Id of the zone. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String partyId, String zoneId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), partyId, zoneId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a specified zone resource under a particular party. - * - * @param partyId Id of the party. - * @param zoneId Id of the zone. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String partyId, String zoneId, RequestOptions requestOptions) { - return deleteWithResponseAsync(partyId, zoneId, requestOptions).block(); - } - - /** - * Returns a paginated list of zone resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
managementZoneIdsList<String>NoManagementZoneIds of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     managementZoneId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Returns a paginated list of zone resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
managementZoneIdsList<String>NoManagementZoneIds of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     managementZoneId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listSinglePageAsync(requestOptions), - nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Returns a paginated list of zone resources across all parties. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
typesList<String>NoTypes of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
managementZoneIdsList<String>NoManagementZoneIds of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
sourcesList<String>NoSources of the Zones. Call {@link RequestOptions#addQueryParam} to add string to array.
idsList<String>NoIds of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
namesList<String>NoNames of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. - * eg. "{testKey} eq {testValue}". Call {@link RequestOptions#addQueryParam} to add string to array.
statusesList<String>NoStatuses of the resource. Call {@link RequestOptions#addQueryParam} to add string to array.
minCreatedDateTimeOffsetDateTimeNoMinimum creation date of resource (inclusive).
maxCreatedDateTimeOffsetDateTimeNoMaximum creation date of resource (inclusive).
minLastModifiedDateTimeOffsetDateTimeNoMinimum last modified date of resource (inclusive).
maxLastModifiedDateTimeOffsetDateTimeNoMaximum last modified date of resource (inclusive).
maxPageSizeIntegerNoMaximum number of items needed (inclusive). - * Minimum = 10, Maximum = 1000, Default value = 50.
skipTokenStringNoSkip token for getting next set of results.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     managementZoneId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return new PagedIterable<>(listAsync(requestOptions)); - } - - /** - * Get a cascade delete job for specified job id. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified job id along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCascadeDeleteJobDetailsWithResponseAsync(String jobId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getCascadeDeleteJobDetails(this.client.getEndpoint(), jobId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get a cascade delete job for specified job id. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a cascade delete job for specified job id along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCascadeDeleteJobDetailsWithResponse(String jobId, RequestOptions requestOptions) { - return getCascadeDeleteJobDetailsWithResponseAsync(jobId, requestOptions).block(); - } - - /** - * Create a cascade delete job for specified zone. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param zoneId ID of the zone to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return schema of cascade delete job along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createCascadeDeleteJobWithResponseAsync(String jobId, String partyId, - String zoneId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createCascadeDeleteJob(this.client.getEndpoint(), jobId, partyId, - zoneId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Create a cascade delete job for specified zone. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param zoneId ID of the zone to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginCreateCascadeDeleteJobAsync(String jobId, String partyId, - String zoneId, RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.createCascadeDeleteJobWithResponseAsync(jobId, partyId, zoneId, requestOptions), - new DefaultPollingStrategy<>(this.client.getHttpPipeline(), - "{endpoint}".replace("{endpoint}", this.client.getEndpoint()), null, - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Create a cascade delete job for specified zone. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Required)
-     *     resourceId: String (Required)
-     *     resourceType: String (Required)
-     *     id: String (Optional)
-     *     status: String(Waiting/Running/Succeeded/Failed/Cancelled) (Optional)
-     *     durationInSeconds: Double (Optional)
-     *     message: String (Optional)
-     *     errorCode: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     lastActionDateTime: OffsetDateTime (Optional)
-     *     startTime: OffsetDateTime (Optional)
-     *     endTime: OffsetDateTime (Optional)
-     * }
-     * }
- * - * @param jobId Job ID supplied by end user. - * @param partyId ID of the associated party. - * @param zoneId ID of the zone to be deleted. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of schema of cascade delete job. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginCreateCascadeDeleteJob(String jobId, String partyId, String zoneId, - RequestOptions requestOptions) { - return this.beginCreateCascadeDeleteJobAsync(jobId, partyId, zoneId, requestOptions).getSyncPoller(); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     managementZoneId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPartyIdNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listByPartyIdNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     partyId: String (Optional)
-     *     type: String (Optional)
-     *     managementZoneId: String (Optional)
-     *     id: String (Optional)
-     *     eTag: String (Optional)
-     *     status: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     modifiedDateTime: OffsetDateTime (Optional)
-     *     source: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     createdBy: String (Optional)
-     *     modifiedBy: String (Optional)
-     *     properties (Optional): {
-     *         String: Object (Optional)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged response contains list of requested objects and a URL link to get the next set of results along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/package-info.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/package-info.java deleted file mode 100644 index 2bf9473ee39c..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/implementation/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * Package containing the implementations for FarmBeatsClient. APIs documentation for Azure AgPlatform DataPlane - * Service. - */ -package com.azure.verticals.agrifood.farming.implementation; diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/package-info.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/package-info.java deleted file mode 100644 index 31407f856367..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/com/azure/verticals/agrifood/farming/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the classes for FarmBeatsClient. APIs documentation for Azure AgPlatform DataPlane Service. */ -package com.azure.verticals.agrifood.farming; diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/module-info.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/module-info.java deleted file mode 100644 index 6fa5e91d773f..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/java/module-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -module com.azure.verticals.agrifood.farming { - requires transitive com.azure.core; - - exports com.azure.verticals.agrifood.farming; -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/resources/azure-verticals-agrifood-farming.properties b/sdk/agrifood/azure-verticals-agrifood-farming/src/main/resources/azure-verticals-agrifood-farming.properties deleted file mode 100644 index ca812989b4f2..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/main/resources/azure-verticals-agrifood-farming.properties +++ /dev/null @@ -1,2 +0,0 @@ -name=${project.artifactId} -version=${project.version} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/samples/README.md b/sdk/agrifood/azure-verticals-agrifood-farming/src/samples/README.md deleted file mode 100644 index c7897324561f..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/samples/README.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -page_type: sample -languages: - - java -products: - - azure -urlFragment: farmbeats-java-samples ---- - -# Azure FarmBeats client library samples for Java - -Azure FarmBeats samples are a set of self-contained Java programs that demonstrate interacting with Azure self-contained service using the client library. Each sample focuses on a specific scenario and can be executed independently. - -## Key concepts - -Key concepts are explained in detail [here][SDK_README_KEY_CONCEPTS]. - -## Getting started - -Getting started explained in detail [here][SDK_README_GETTING_STARTED]. - -## Examples - -The following sections provide code samples covering common scenario operations with the Azure FarmBeats client library. - -All of these samples need the endpoint to your FarmBeats resource, and your FarmBeats API key. - -|**File Name**|**Description**| -|----------------|-------------| -|[CreateFarms.java][create_farms]|Create a farm in FarmBeats| - -## Troubleshooting - -Troubleshooting steps can be found [here][SDK_README_TROUBLESHOOTING]. - -## Next steps - -See [Next steps][SDK_README_NEXT_STEPS]. - -## Contributing - -If you would like to become an active contributor to this project please refer to our [Contribution Guidelines][SDK_README_CONTRIBUTING] for more information. - - - - - - - - - diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/samples/java/com/azure/verticals/agrifood/farming/ReadmeSamples.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/samples/java/com/azure/verticals/agrifood/farming/ReadmeSamples.java deleted file mode 100644 index bfda43d2e46b..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/samples/java/com/azure/verticals/agrifood/farming/ReadmeSamples.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.verticals.agrifood.farming; - -import java.util.HashMap; -import java.util.Map; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.identity.DefaultAzureCredentialBuilder; - -/** - * Code samples for the README.md - */ -public class ReadmeSamples { - /** - * Sample for creating low level client. - */ - public void createClient() { - // BEGIN: readme-sample-createPartiesClient - String endpoint = "https://.farmbeats.azure.net"; - - // Create Parties Client - PartiesClientBuilder partiesBuilder = new PartiesClientBuilder() - .endpoint(endpoint) - .credential(new DefaultAzureCredentialBuilder().build()); - PartiesAsyncClient partiesClient = partiesBuilder.buildAsyncClient(); - - // END: readme-sample-createPartiesClient - // BEGIN: readme-sample-createBoundariesClient - // Create Boundaries Client - BoundariesClientBuilder boundariesBuilder = new BoundariesClientBuilder() - .endpoint(endpoint) - .credential(new DefaultAzureCredentialBuilder().build()); - BoundariesAsyncClient boundariesClient = boundariesBuilder.buildAsyncClient(); - // END: readme-sample-createBoundariesClient - - // BEGIN: readme-sample-createScenesClient - // Create Scenes Client - ScenesClientBuilder scenesBuilder = new ScenesClientBuilder() - .endpoint(endpoint) - .credential(new DefaultAzureCredentialBuilder().build()); - ScenesAsyncClient scenesClient = scenesBuilder.buildAsyncClient(); - // END: readme-sample-createScenesClient - - // BEGIN: readme-sample-createFarmHierarchy - // Create Party - Map partyData = new HashMap<>(); - partyData.put("name", "party1"); - BinaryData party = BinaryData.fromObject(partyData); - partiesClient.createOrUpdateWithResponse("contoso-party", party, null).block(); - - // Get Party - Response response = partiesClient.getWithResponse("contoso-party", new RequestOptions()).block(); - System.out.println(response.getValue()); - - // Create Boundary - BinaryData boundary = BinaryData.fromString("{\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[73.70457172393799,20.545385304358106],[73.70457172393799,20.545385304358106],[73.70448589324951,20.542411534243367],[73.70877742767334,20.541688176010233],[73.71023654937744,20.545083911372505],[73.70663166046143,20.546992723579137],[73.70457172393799,20.545385304358106]]]},\"name\":\"string\",\"description\":\"string\"}"); - response = boundariesClient.createOrUpdateWithResponse("contoso-party", "contoso-boundary", boundary, null).block(); - System.out.println(response.getValue()); - // END: readme-sample-createFarmHierarchy - - // BEGIN: readme-sample-ingestSatelliteData - // Trigger Satellite job and wait for completion - BinaryData satelliteJob = BinaryData.fromString("{\"boundaryId\":\"contoso-boundary\",\"endDateTime\":\"2022-02-01T00:00:00Z\",\"partyId\":\"contoso-party\",\"source\":\"Sentinel_2_L2A\",\"startDateTime\":\"2022-01-01T00:00:00Z\",\"provider\":\"Microsoft\",\"data\":{\"imageNames\":[\"NDVI\"],\"imageFormats\":[\"TIF\"],\"imageResolutions\":[10]},\"name\":\"string\",\"description\":\"string\"}"); - scenesClient.beginCreateSatelliteDataIngestionJob("contoso-job-46856", satelliteJob, null).getSyncPoller().waitForCompletion(); - System.out.println(scenesClient.getSatelliteDataIngestionJobDetailsWithResponse("contoso-job-46856", null).block().getValue()); - - // Iterate through ingested scenes - Iterable scenes = scenesClient.list("Microsoft", "contoso-party", "contoso-boundary", "Sentinel_2_L2A", null).toIterable(); - scenes.forEach(scene -> System.out.println(scene)); - // END: readme-sample-ingestSatelliteData - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/test/java/com/azure/verticals/agrifood/farming/PartiesClientTests.java b/sdk/agrifood/azure-verticals-agrifood-farming/src/test/java/com/azure/verticals/agrifood/farming/PartiesClientTests.java deleted file mode 100644 index bc2d173e7a3e..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/test/java/com/azure/verticals/agrifood/farming/PartiesClientTests.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.verticals.agrifood.farming; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.policy.HttpLogDetailLevel; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.test.TestProxyTestBase; -import com.azure.core.test.TestMode; -import com.azure.core.test.annotation.LiveOnly; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollResponse; -import com.azure.identity.DefaultAzureCredentialBuilder; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -import java.time.OffsetDateTime; - -// Package marked to be deprecated -@LiveOnly() -public class PartiesClientTests extends TestProxyTestBase { - private final String defaultEndpoint = "https://REDACTED.farmbeats.azure.net"; - - private PartiesAsyncClient createPartiesClient() { - PartiesClientBuilder builder = new PartiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("FARMBEATS_ENDPOINT", defaultEndpoint)) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)); - if (getTestMode() == TestMode.PLAYBACK) { - builder.httpClient(interceptorManager.getPlaybackClient()) - .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); - } else if (getTestMode() == TestMode.RECORD) { - builder.addPolicy(interceptorManager.getRecordPolicy()) - .credential(new DefaultAzureCredentialBuilder().build()); - } else if (getTestMode() == TestMode.LIVE) { - builder.credential(new DefaultAzureCredentialBuilder().build()); - } - return builder.buildAsyncClient(); - } - - private BoundariesAsyncClient createBoundariesClient() { - BoundariesClientBuilder builder = new BoundariesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("FARMBEATS_ENDPOINT", defaultEndpoint)) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)); - if (getTestMode() == TestMode.PLAYBACK) { - builder.httpClient(interceptorManager.getPlaybackClient()) - .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); - } else if (getTestMode() == TestMode.RECORD) { - builder.addPolicy(interceptorManager.getRecordPolicy()) - .credential(new DefaultAzureCredentialBuilder().build()); - } else if (getTestMode() == TestMode.LIVE) { - builder.credential(new DefaultAzureCredentialBuilder().build()); - } - return builder.buildAsyncClient(); - } - - private ScenesAsyncClient createScenesClient() { - ScenesClientBuilder builder = new ScenesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("FARMBEATS_ENDPOINT", defaultEndpoint)) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)); - if (getTestMode() == TestMode.PLAYBACK) { - builder.httpClient(interceptorManager.getPlaybackClient()) - .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); - } else if (getTestMode() == TestMode.RECORD) { - builder.addPolicy(interceptorManager.getRecordPolicy()) - .credential(new DefaultAzureCredentialBuilder().build()); - } else if (getTestMode() == TestMode.LIVE) { - builder.credential(new DefaultAzureCredentialBuilder().build()); - } - return builder.buildAsyncClient(); - } - - @Test - public void testParties() { - PartiesAsyncClient client = createPartiesClient(); - BinaryData party = BinaryData.fromString("{\"name\":\"party1\"}"); - client.createOrUpdateWithResponse("contoso-party", party, null).block(); - Response response = client.getWithResponse("contoso-party", new RequestOptions()).block(); - Assertions.assertNotNull(response.getValue()); - } - - @Test - public void testSatelliteJob() { - BoundariesAsyncClient boundariesClient = createBoundariesClient(); - BinaryData boundary = BinaryData.fromString( - "{\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[73.70457172393799,20.545385304358106],[73.70457172393799,20.545385304358106],[73.70448589324951,20.542411534243367],[73.70877742767334,20.541688176010233],[73.71023654937744,20.545083911372505],[73.70663166046143,20.546992723579137],[73.70457172393799,20.545385304358106]]]},\"name\":\"string\",\"description\":\"string\"}"); - Response response - = boundariesClient.createOrUpdateWithResponse("contoso-party", "contoso-boundary", boundary, null).block(); - Assertions.assertNotNull(response.getValue()); - - ScenesAsyncClient scenesClient = createScenesClient(); - BinaryData satelliteJob = BinaryData.fromString( - "{\"boundaryId\":\"contoso-boundary\",\"endDateTime\":\"2022-02-01T00:00:00Z\",\"partyId\":\"contoso-party\",\"source\":\"Sentinel_2_L2A\",\"startDateTime\":\"2022-01-01T00:00:00Z\",\"provider\":\"Microsoft\",\"data\":{\"imageNames\":[\"NDVI\"],\"imageFormats\":[\"TIF\"],\"imageResolutions\":[10]},\"name\":\"string\",\"description\":\"string\"}"); - PollResponse satelliteJobPollResponse = setPlaybackSyncPollerPollInterval( - scenesClient.beginCreateSatelliteDataIngestionJob("contoso-job-35864", satelliteJob, null).getSyncPoller()) - .waitForCompletion(); - Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, - satelliteJobPollResponse.getStatus()); - - Assertions.assertNotNull( - scenesClient.getSatelliteDataIngestionJobDetailsWithResponse("contoso-job-35864", null).block().getValue()); - - Iterable scenes - = scenesClient.list("Microsoft", "contoso-party", "contoso-boundary", "Sentinel_2_L2A", null).toIterable(); - scenes.forEach(scene -> Assertions.assertNotNull(scene)); - } -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/test/resources/session-records/PartiesClientTests.testList.json b/sdk/agrifood/azure-verticals-agrifood-farming/src/test/resources/session-records/PartiesClientTests.testList.json deleted file mode 100644 index 536d58eb7fc4..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/test/resources/session-records/PartiesClientTests.testList.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "GET", - "Uri" : "https://REDACTED.farmbeats.azure.net/parties/contoso-party?api-version=2022-11-01-preview", - "Headers" : { - "User-Agent" : "azsdk-java-azure-verticals-agrifood-farming/1.0.0-beta.3 (17.0.6; Windows 11; 10.0)", - "x-ms-client-request-id" : "821b9a53-7312-4fb1-8c90-a8c69268b3e0" - }, - "Response" : { - "api-supported-versions" : "2022-11-01-preview", - "x-frame-options" : "SAMEORIGIN", - "Connection" : "keep-alive", - "mise-correlation-id" : "8572920b-a78a-4b17-8b08-a04326b6af4e", - "retry-after" : "0", - "StatusCode" : "200", - "Date" : "Wed, 15 Feb 2023 23:50:52 GMT", - "strict-transport-security" : "max-age=15724800; includeSubDomains", - "content-security-policy" : "self", - "x-content-type-options" : "nosniff", - "x-ms-throttle-information" : "100", - "etag" : "200018a4-0000-0600-0000-63ed57680000", - "Content-Length" : "254", - "x-ms-request-id" : "669c430683d37065b505173dd136d76f", - "Body" : "{\"id\":\"contoso-party\",\"eTag\":\"200018a4-0000-0600-0000-63ed57680000\",\"createdDateTime\":\"2023-02-15T22:06:32Z\",\"modifiedDateTime\":\"2023-02-15T22:06:32Z\",\"createdBy\":\"9002b50e-dc98-445e-a865-72dce38ecafd\",\"modifiedBy\":\"9002b50e-dc98-445e-a865-72dce38ecafd\"}", - "Content-Type" : "application/json; charset=utf-8" - }, - "Exception" : null - } ], - "variables" : [ ] -} \ No newline at end of file diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/test/resources/session-records/PartiesClientTests.testParties.json b/sdk/agrifood/azure-verticals-agrifood-farming/src/test/resources/session-records/PartiesClientTests.testParties.json deleted file mode 100644 index 45d4c55b232f..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/test/resources/session-records/PartiesClientTests.testParties.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PATCH", - "Uri" : "https://REDACTED.farmbeats.azure.net/parties/contoso-party?api-version=2022-11-01-preview", - "Headers" : { - "User-Agent" : "azsdk-java-azure-verticals-agrifood-farming/1.0.0-beta.3 (17.0.6; Windows 11; 10.0)", - "x-ms-client-request-id" : "2438f474-91c7-4d7e-bb8e-bcab7467b8dc", - "Content-Type" : "application/merge-patch+json" - }, - "Response" : { - "api-supported-versions" : "2022-11-01-preview", - "x-frame-options" : "SAMEORIGIN", - "Connection" : "keep-alive", - "mise-correlation-id" : "5dc83098-a527-4286-855d-5dd99b77aa3d", - "retry-after" : "0", - "StatusCode" : "200", - "Date" : "Wed, 22 Feb 2023 13:02:43 GMT", - "strict-transport-security" : "max-age=15724800; includeSubDomains", - "content-security-policy" : "self", - "x-content-type-options" : "nosniff", - "Vary" : "Accept-Encoding", - "x-ms-throttle-information" : "1000", - "etag" : "6200f43f-0000-0600-0000-63f612720000", - "Content-Length" : "270", - "x-ms-request-id" : "2c8149e5252167ee95095a8746f38494", - "Body" : "{\"id\":\"contoso-party\",\"eTag\":\"6200f43f-0000-0600-0000-63f612720000\",\"createdDateTime\":\"2023-02-22T10:08:57Z\",\"modifiedDateTime\":\"2023-02-22T13:02:42Z\",\"name\":\"party1\",\"createdBy\":\"9002b50e-dc98-445e-a865-72dce38ecafd\",\"modifiedBy\":\"9002b50e-dc98-445e-a865-72dce38ecafd\"}", - "Content-Type" : "application/json; charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.farmbeats.azure.net/parties/contoso-party?api-version=2022-11-01-preview", - "Headers" : { - "User-Agent" : "azsdk-java-azure-verticals-agrifood-farming/1.0.0-beta.3 (17.0.6; Windows 11; 10.0)", - "x-ms-client-request-id" : "c6b1cad8-3a91-41bd-b8dd-cbf3acfac1e0" - }, - "Response" : { - "api-supported-versions" : "2022-11-01-preview", - "x-frame-options" : "SAMEORIGIN", - "Connection" : "keep-alive", - "mise-correlation-id" : "61c9314f-79e9-4f32-94b1-d0f06e2b8fcc", - "retry-after" : "0", - "StatusCode" : "200", - "Date" : "Wed, 22 Feb 2023 13:02:43 GMT", - "strict-transport-security" : "max-age=15724800; includeSubDomains", - "content-security-policy" : "self", - "x-content-type-options" : "nosniff", - "Vary" : "Accept-Encoding", - "x-ms-throttle-information" : "100", - "etag" : "6200f43f-0000-0600-0000-63f612720000", - "Content-Length" : "270", - "x-ms-request-id" : "b509fb5d848560fe899bbb0d04ba6b14", - "Body" : "{\"id\":\"contoso-party\",\"eTag\":\"6200f43f-0000-0600-0000-63f612720000\",\"createdDateTime\":\"2023-02-22T10:08:57Z\",\"modifiedDateTime\":\"2023-02-22T13:02:42Z\",\"name\":\"party1\",\"createdBy\":\"9002b50e-dc98-445e-a865-72dce38ecafd\",\"modifiedBy\":\"9002b50e-dc98-445e-a865-72dce38ecafd\"}", - "Content-Type" : "application/json; charset=utf-8" - }, - "Exception" : null - } ], - "variables" : [ ] -} \ No newline at end of file diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/src/test/resources/session-records/PartiesClientTests.testSatelliteJob.json b/sdk/agrifood/azure-verticals-agrifood-farming/src/test/resources/session-records/PartiesClientTests.testSatelliteJob.json deleted file mode 100644 index 3340a164b4c8..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/src/test/resources/session-records/PartiesClientTests.testSatelliteJob.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PATCH", - "Uri" : "https://REDACTED.farmbeats.azure.net/parties/contoso-party/boundaries/contoso-boundary?api-version=2022-11-01-preview", - "Headers" : { - "User-Agent" : "azsdk-java-azure-verticals-agrifood-farming/1.0.0-beta.3 (17.0.6; Windows 11; 10.0)", - "x-ms-client-request-id" : "dd1d1278-1adf-44f3-803e-bc022e8f4da9", - "Content-Type" : "application/merge-patch+json" - }, - "Response" : { - "api-supported-versions" : "2021-07-31-preview, 2022-11-01-preview", - "x-frame-options" : "SAMEORIGIN", - "Connection" : "keep-alive", - "mise-correlation-id" : "a88ec8f5-6c1c-4d12-8741-13db99b6f486", - "retry-after" : "0", - "StatusCode" : "200", - "Date" : "Wed, 22 Feb 2023 13:02:44 GMT", - "strict-transport-security" : "max-age=15724800; includeSubDomains", - "content-security-policy" : "self", - "x-content-type-options" : "nosniff", - "Vary" : "Accept-Encoding", - "x-ms-throttle-information" : "1000", - "etag" : "6200d32c-0000-0600-0000-63f611be0000", - "Content-Length" : "975", - "x-ms-request-id" : "8c78c28c88751a8ef1ac185eabaf1057", - "Body" : "{\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[73.70457172393799,20.545385304358106],[73.70457172393799,20.545385304358106],[73.70448589324951,20.542411534243367],[73.70877742767334,20.541688176010233],[73.71023654937744,20.545083911372505],[73.70663166046143,20.546992723579137],[73.70457172393799,20.545385304358106]]]},\"crs\":\"WGS84\",\"centroid\":{\"type\":\"Point\",\"coordinates\":[73.70711478791443,20.54418916247634]},\"bbox\":{\"type\":\"Polygon\",\"coordinates\":[[[73.70448589324951,20.541688176010233],[73.70448589324951,20.546992723579137],[73.71023654937744,20.546992723579137],[73.71023654937744,20.541688176010233]]]},\"partyId\":\"contoso-party\",\"area\":{\"unit\":\"Acre\",\"value\":60.405},\"id\":\"contoso-boundary\",\"eTag\":\"6200d32c-0000-0600-0000-63f611be0000\",\"createdDateTime\":\"2023-02-22T10:52:14Z\",\"modifiedDateTime\":\"2023-02-22T13:02:44Z\",\"name\":\"string\",\"description\":\"string\",\"createdBy\":\"9002b50e-dc98-445e-a865-72dce38ecafd\",\"modifiedBy\":\"9002b50e-dc98-445e-a865-72dce38ecafd\"}", - "Content-Type" : "application/json; charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "PUT", - "Uri" : "https://REDACTED.farmbeats.azure.net/scenes/satellite/ingest-data/contoso-job-35864?api-version=2022-11-01-preview", - "Headers" : { - "User-Agent" : "azsdk-java-azure-verticals-agrifood-farming/1.0.0-beta.3 (17.0.6; Windows 11; 10.0)", - "x-ms-client-request-id" : "9a11de62-4bc5-4c4e-a334-b3377c3f0140", - "Content-Type" : "application/json" - }, - "Response" : { - "api-supported-versions" : "2021-07-31-preview, 2022-11-01-preview", - "x-frame-options" : "SAMEORIGIN", - "Connection" : "keep-alive", - "mise-correlation-id" : "72beacd0-a70a-4dd4-be7e-7b4281b1127a", - "retry-after" : "0", - "StatusCode" : "202", - "Date" : "Wed, 22 Feb 2023 13:02:45 GMT", - "strict-transport-security" : "max-age=15724800; includeSubDomains", - "operation-location" : "https://bb-prod-wcus-1.farmbeats.azure.net/scenes/satellite/ingest-data/contoso-job-35864?api-version=2022-11-01-preview", - "content-security-policy" : "self", - "x-content-type-options" : "nosniff", - "x-ms-throttle-information" : "1293", - "location" : "https://bb-prod-wcus-1.farmbeats.azure.net/scenes/satellite/ingest-data/contoso-job-35864?api-version=2022-11-01-preview", - "Content-Length" : "558", - "x-ms-request-id" : "12b510d451c9d94276d8e5f71d05bc40", - "Body" : "{\"partyId\":\"contoso-party\",\"boundaryId\":\"contoso-boundary\",\"startDateTime\":\"2022-01-01T00:00:00Z\",\"endDateTime\":\"2022-02-01T00:00:00Z\",\"provider\":\"Microsoft\",\"source\":\"Sentinel_2_L2A\",\"data\":{\"imageNames\":[\"NDVI\"],\"imageFormats\":[\"TIF\"],\"imageResolutions\":[10.0]},\"id\":\"contoso-job-35864\",\"status\":\"Waiting\",\"message\":\"Created job 'contoso-job-35864' to fetch satellite data for boundary 'contoso-boundary' from startDate '01/01/2022' to endDate '02/01/2022' (both inclusive).\",\"createdDateTime\":\"2023-02-22T13:02:44Z\",\"name\":\"string\",\"description\":\"string\"}", - "Content-Type" : "application/json; charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.farmbeats.azure.net/scenes/satellite/ingest-data/contoso-job-35864?api-version=2022-11-01-preview", - "Headers" : { - "User-Agent" : "azsdk-java-azure-verticals-agrifood-farming/1.0.0-beta.3 (17.0.6; Windows 11; 10.0)", - "x-ms-client-request-id" : "8251a8ab-9584-48d5-850b-5ec92b8096ff" - }, - "Response" : { - "api-supported-versions" : "2021-07-31-preview, 2022-11-01-preview", - "x-frame-options" : "SAMEORIGIN", - "Connection" : "keep-alive", - "mise-correlation-id" : "529be0cf-cd3c-4b57-9ada-c52b78b7f629", - "retry-after" : "0", - "StatusCode" : "200", - "Date" : "Wed, 22 Feb 2023 13:02:46 GMT", - "strict-transport-security" : "max-age=15724800; includeSubDomains", - "content-security-policy" : "self", - "x-content-type-options" : "nosniff", - "Vary" : "Accept-Encoding", - "x-ms-throttle-information" : "100", - "Content-Length" : "637", - "x-ms-request-id" : "873456b81ee6f3ee9f7ab5da0984dfcc", - "Body" : "{\"partyId\":\"contoso-party\",\"boundaryId\":\"contoso-boundary\",\"startDateTime\":\"2022-01-01T00:00:00Z\",\"endDateTime\":\"2022-02-01T00:00:00Z\",\"provider\":\"Microsoft\",\"source\":\"Sentinel_2_L2A\",\"data\":{\"imageNames\":[\"NDVI\"],\"imageFormats\":[\"TIF\"],\"imageResolutions\":[10.0]},\"id\":\"contoso-job-35864\",\"status\":\"Waiting\",\"message\":\"Created job 'contoso-job-35864' to fetch satellite data for boundary 'contoso-boundary' from startDate '01/01/2022' to endDate '02/01/2022' (both inclusive).\",\"createdDateTime\":\"2023-02-22T13:02:44Z\",\"lastActionDateTime\":\"2023-02-22T13:02:44Z\",\"startTime\":\"2023-02-22T13:02:44Z\",\"name\":\"string\",\"description\":\"string\"}", - "Content-Type" : "application/json; charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.farmbeats.azure.net/scenes/satellite/ingest-data/contoso-job-35864?api-version=2022-11-01-preview", - "Headers" : { - "User-Agent" : "azsdk-java-azure-verticals-agrifood-farming/1.0.0-beta.3 (17.0.6; Windows 11; 10.0)", - "x-ms-client-request-id" : "5476ed80-6396-4a09-87ea-5463192deebf" - }, - "Response" : { - "api-supported-versions" : "2021-07-31-preview, 2022-11-01-preview", - "x-frame-options" : "SAMEORIGIN", - "Connection" : "keep-alive", - "mise-correlation-id" : "4cb0a2b5-cb9a-42ca-b0d3-6cd87a49514c", - "retry-after" : "0", - "StatusCode" : "200", - "Date" : "Wed, 22 Feb 2023 13:02:47 GMT", - "strict-transport-security" : "max-age=15724800; includeSubDomains", - "content-security-policy" : "self", - "x-content-type-options" : "nosniff", - "Vary" : "Accept-Encoding", - "x-ms-throttle-information" : "100", - "Content-Length" : "637", - "x-ms-request-id" : "0d1f6269719f873362a39119ccf748e7", - "Body" : "{\"partyId\":\"contoso-party\",\"boundaryId\":\"contoso-boundary\",\"startDateTime\":\"2022-01-01T00:00:00Z\",\"endDateTime\":\"2022-02-01T00:00:00Z\",\"provider\":\"Microsoft\",\"source\":\"Sentinel_2_L2A\",\"data\":{\"imageNames\":[\"NDVI\"],\"imageFormats\":[\"TIF\"],\"imageResolutions\":[10.0]},\"id\":\"contoso-job-35864\",\"status\":\"Succeeded\",\"message\":\"Created job 'contoso-job-35864' to fetch satellite data for boundary 'contoso-boundary' from startDate '01/01/2022' to endDate '02/01/2022' (both inclusive).\",\"createdDateTime\":\"2023-02-22T13:02:44Z\",\"lastActionDateTime\":\"2023-02-22T13:02:44Z\",\"startTime\":\"2023-02-22T13:02:44Z\",\"name\":\"string\",\"description\":\"string\"}", - "Content-Type" : "application/json; charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.farmbeats.azure.net/scenes/satellite/ingest-data/contoso-job-35864?api-version=2022-11-01-preview", - "Headers" : { - "User-Agent" : "azsdk-java-azure-verticals-agrifood-farming/1.0.0-beta.3 (17.0.6; Windows 11; 10.0)", - "x-ms-client-request-id" : "5476ed80-6396-4a09-87ea-5463192deebf" - }, - "Response" : { - "api-supported-versions" : "2021-07-31-preview, 2022-11-01-preview", - "x-frame-options" : "SAMEORIGIN", - "Connection" : "keep-alive", - "mise-correlation-id" : "4cb0a2b5-cb9a-42ca-b0d3-6cd87a49514c", - "retry-after" : "0", - "StatusCode" : "200", - "Date" : "Wed, 22 Feb 2023 13:02:47 GMT", - "strict-transport-security" : "max-age=15724800; includeSubDomains", - "content-security-policy" : "self", - "x-content-type-options" : "nosniff", - "Vary" : "Accept-Encoding", - "x-ms-throttle-information" : "100", - "Content-Length" : "637", - "x-ms-request-id" : "0d1f6269719f873362a39119ccf748e7", - "Body" : "{\"partyId\":\"contoso-party\",\"boundaryId\":\"contoso-boundary\",\"startDateTime\":\"2022-01-01T00:00:00Z\",\"endDateTime\":\"2022-02-01T00:00:00Z\",\"provider\":\"Microsoft\",\"source\":\"Sentinel_2_L2A\",\"data\":{\"imageNames\":[\"NDVI\"],\"imageFormats\":[\"TIF\"],\"imageResolutions\":[10.0]},\"id\":\"contoso-job-35864\",\"status\":\"Succeeded\",\"message\":\"Created job 'contoso-job-35864' to fetch satellite data for boundary 'contoso-boundary' from startDate '01/01/2022' to endDate '02/01/2022' (both inclusive).\",\"createdDateTime\":\"2023-02-22T13:02:44Z\",\"lastActionDateTime\":\"2023-02-22T13:02:44Z\",\"startTime\":\"2023-02-22T13:02:44Z\",\"name\":\"string\",\"description\":\"string\"}", - "Content-Type" : "application/json; charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.farmbeats.azure.net/scenes?provider=Microsoft&partyId=contoso-party&boundaryId=contoso-boundary&source=Sentinel_2_L2A&api-version=2022-11-01-preview", - "Headers" : { - "User-Agent" : "azsdk-java-azure-verticals-agrifood-farming/1.0.0-beta.3 (17.0.6; Windows 11; 10.0)", - "x-ms-client-request-id" : "6d7a4fcc-71e1-465a-b064-c7dbf351fc98" - }, - "Response" : { - "api-supported-versions" : "2021-07-31-preview, 2022-11-01-preview", - "x-frame-options" : "SAMEORIGIN", - "Connection" : "keep-alive", - "mise-correlation-id" : "b7611cad-9568-4a92-aa0e-fb0f966693fb", - "retry-after" : "0", - "StatusCode" : "200", - "Date" : "Wed, 22 Feb 2023 13:02:47 GMT", - "strict-transport-security" : "max-age=15724800; includeSubDomains", - "content-security-policy" : "self", - "x-content-type-options" : "nosniff", - "Vary" : "Accept-Encoding", - "x-ms-throttle-information" : "6500", - "Content-Length" : "7383", - "x-ms-request-id" : "2671a93703b3c7ea56560ef7abde22e7", - "Body" : "{\"value\":[{\"sceneDateTime\":\"2022-02-01T00:00:00Z\",\"provider\":\"Microsoft\",\"source\":\"Sentinel_2_L2A\",\"imageFiles\":[{\"fileLink\":\"https://bb-prod-wcus-1.farmbeats.azure.net/scenes/downloadFiles?api-version=2022-11-01-preview&filePath=Microsoft%2fSentinel_2_L2A%2fcontoso-party%2fcontoso-boundary%2f2022-02-01%2f00-00-00%2fndvi_10.tif\",\"name\":\"NDVI\",\"resolution\":10.0}],\"imageFormat\":\"TIF\",\"cloudCoverPercentage\":0.0,\"darkPixelPercentage\":0.0,\"ndviMedianValue\":0.6577085256576538,\"boundaryId\":\"contoso-boundary\",\"partyId\":\"contoso-party\",\"id\":\"dae1a164-ffba-0e16-749e-43eefbe9cebf\",\"eTag\":\"0000a71d-0000-0600-0000-63f5f3ff0000\"},{\"sceneDateTime\":\"2022-01-29T00:00:00Z\",\"provider\":\"Microsoft\",\"source\":\"Sentinel_2_L2A\",\"imageFiles\":[{\"fileLink\":\"https://bb-prod-wcus-1.farmbeats.azure.net/scenes/downloadFiles?api-version=2022-11-01-preview&filePath=Microsoft%2fSentinel_2_L2A%2fcontoso-party%2fcontoso-boundary%2f2022-01-29%2f00-00-00%2fndvi_10.tif\",\"name\":\"NDVI\",\"resolution\":10.0}],\"imageFormat\":\"TIF\",\"cloudCoverPercentage\":0.0,\"darkPixelPercentage\":0.0,\"ndviMedianValue\":0.6575567722320557,\"boundaryId\":\"contoso-boundary\",\"partyId\":\"contoso-party\",\"id\":\"b7de3ec1-c81f-d995-50a2-0f53f89bc3d7\",\"eTag\":\"0000a81d-0000-0600-0000-63f5f3ff0000\"},{\"sceneDateTime\":\"2022-01-27T00:00:00Z\",\"provider\":\"Microsoft\",\"source\":\"Sentinel_2_L2A\",\"imageFiles\":[{\"fileLink\":\"https://bb-prod-wcus-1.farmbeats.azure.net/scenes/downloadFiles?api-version=2022-11-01-preview&filePath=Microsoft%2fSentinel_2_L2A%2fcontoso-party%2fcontoso-boundary%2f2022-01-27%2f00-00-00%2fndvi_10.tif\",\"name\":\"NDVI\",\"resolution\":10.0}],\"imageFormat\":\"TIF\",\"cloudCoverPercentage\":0.0,\"darkPixelPercentage\":0.0,\"ndviMedianValue\":0.5855094194412231,\"boundaryId\":\"contoso-boundary\",\"partyId\":\"contoso-party\",\"id\":\"db64ac3e-f194-7234-b196-a0068e8d3caa\",\"eTag\":\"0000a61d-0000-0600-0000-63f5f3fb0000\"},{\"sceneDateTime\":\"2022-01-24T00:00:00Z\",\"provider\":\"Microsoft\",\"source\":\"Sentinel_2_L2A\",\"imageFiles\":[{\"fileLink\":\"https://bb-prod-wcus-1.farmbeats.azure.net/scenes/downloadFiles?api-version=2022-11-01-preview&filePath=Microsoft%2fSentinel_2_L2A%2fcontoso-party%2fcontoso-boundary%2f2022-01-24%2f00-00-00%2fndvi_10.tif\",\"name\":\"NDVI\",\"resolution\":10.0}],\"imageFormat\":\"TIF\",\"cloudCoverPercentage\":0.0,\"darkPixelPercentage\":0.0,\"ndviMedianValue\":0.6118580102920532,\"boundaryId\":\"contoso-boundary\",\"partyId\":\"contoso-party\",\"id\":\"1ae8a2e5-c07d-9924-7ec7-bb93e57f6ca9\",\"eTag\":\"0000a51d-0000-0600-0000-63f5f3fb0000\"},{\"sceneDateTime\":\"2022-01-22T00:00:00Z\",\"provider\":\"Microsoft\",\"source\":\"Sentinel_2_L2A\",\"imageFiles\":[{\"fileLink\":\"https://bb-prod-wcus-1.farmbeats.azure.net/scenes/downloadFiles?api-version=2022-11-01-preview&filePath=Microsoft%2fSentinel_2_L2A%2fcontoso-party%2fcontoso-boundary%2f2022-01-22%2f00-00-00%2fndvi_10.tif\",\"name\":\"NDVI\",\"resolution\":10.0}],\"imageFormat\":\"TIF\",\"cloudCoverPercentage\":61.209,\"darkPixelPercentage\":0.0,\"ndviMedianValue\":0.2613046169281006,\"boundaryId\":\"contoso-boundary\",\"partyId\":\"contoso-party\",\"id\":\"c70eb0a5-a0cc-1f4a-9fea-db77359ad392\",\"eTag\":\"0000a41d-0000-0600-0000-63f5f3fb0000\"},{\"sceneDateTime\":\"2022-01-19T00:00:00Z\",\"provider\":\"Microsoft\",\"source\":\"Sentinel_2_L2A\",\"imageFiles\":[{\"fileLink\":\"https://bb-prod-wcus-1.farmbeats.azure.net/scenes/downloadFiles?api-version=2022-11-01-preview&filePath=Microsoft%2fSentinel_2_L2A%2fcontoso-party%2fcontoso-boundary%2f2022-01-19%2f00-00-00%2fndvi_10.tif\",\"name\":\"NDVI\",\"resolution\":10.0}],\"imageFormat\":\"TIF\",\"cloudCoverPercentage\":0.0,\"darkPixelPercentage\":0.0,\"ndviMedianValue\":0.6795690655708313,\"boundaryId\":\"contoso-boundary\",\"partyId\":\"contoso-party\",\"id\":\"c5715d58-8e82-c729-1551-41ed78da66c3\",\"eTag\":\"0000a31d-0000-0600-0000-63f5f3fb0000\"},{\"sceneDateTime\":\"2022-01-17T00:00:00Z\",\"provider\":\"Microsoft\",\"source\":\"Sentinel_2_L2A\",\"imageFiles\":[{\"fileLink\":\"https://bb-prod-wcus-1.farmbeats.azure.net/scenes/downloadFiles?api-version=2022-11-01-preview&filePath=Microsoft%2fSentinel_2_L2A%2fcontoso-party%2fcontoso-boundary%2f2022-01-17%2f00-00-00%2fndvi_10.tif\",\"name\":\"NDVI\",\"resolution\":10.0}],\"imageFormat\":\"TIF\",\"cloudCoverPercentage\":0.0,\"darkPixelPercentage\":0.0,\"ndviMedianValue\":0.7040629386901855,\"boundaryId\":\"contoso-boundary\",\"partyId\":\"contoso-party\",\"id\":\"369e719c-ddb5-b2cd-91eb-8c04f9a398ec\",\"eTag\":\"0000a11d-0000-0600-0000-63f5f3fb0000\"},{\"sceneDateTime\":\"2022-01-14T00:00:00Z\",\"provider\":\"Microsoft\",\"source\":\"Sentinel_2_L2A\",\"imageFiles\":[{\"fileLink\":\"https://bb-prod-wcus-1.farmbeats.azure.net/scenes/downloadFiles?api-version=2022-11-01-preview&filePath=Microsoft%2fSentinel_2_L2A%2fcontoso-party%2fcontoso-boundary%2f2022-01-14%2f00-00-00%2fndvi_10.tif\",\"name\":\"NDVI\",\"resolution\":10.0}],\"imageFormat\":\"TIF\",\"cloudCoverPercentage\":0.0,\"darkPixelPercentage\":0.0,\"ndviMedianValue\":0.45221132040023804,\"boundaryId\":\"contoso-boundary\",\"partyId\":\"contoso-party\",\"id\":\"6352bfa2-3146-25ac-8654-cc70f083a45e\",\"eTag\":\"0000a21d-0000-0600-0000-63f5f3fb0000\"},{\"sceneDateTime\":\"2022-01-12T00:00:00Z\",\"provider\":\"Microsoft\",\"source\":\"Sentinel_2_L2A\",\"imageFiles\":[{\"fileLink\":\"https://bb-prod-wcus-1.farmbeats.azure.net/scenes/downloadFiles?api-version=2022-11-01-preview&filePath=Microsoft%2fSentinel_2_L2A%2fcontoso-party%2fcontoso-boundary%2f2022-01-12%2f00-00-00%2fndvi_10.tif\",\"name\":\"NDVI\",\"resolution\":10.0}],\"imageFormat\":\"TIF\",\"cloudCoverPercentage\":0.0,\"darkPixelPercentage\":0.0,\"ndviMedianValue\":0.7023664116859436,\"boundaryId\":\"contoso-boundary\",\"partyId\":\"contoso-party\",\"id\":\"e8e85adc-f7d6-beb8-e006-d8e2cc252ccf\",\"eTag\":\"00009f1d-0000-0600-0000-63f5f3fb0000\"},{\"sceneDateTime\":\"2022-01-09T00:00:00Z\",\"provider\":\"Microsoft\",\"source\":\"Sentinel_2_L2A\",\"imageFiles\":[{\"fileLink\":\"https://bb-prod-wcus-1.farmbeats.azure.net/scenes/downloadFiles?api-version=2022-11-01-preview&filePath=Microsoft%2fSentinel_2_L2A%2fcontoso-party%2fcontoso-boundary%2f2022-01-09%2f00-00-00%2fndvi_10.tif\",\"name\":\"NDVI\",\"resolution\":10.0}],\"imageFormat\":\"TIF\",\"cloudCoverPercentage\":0.0,\"darkPixelPercentage\":0.0,\"ndviMedianValue\":0.7272555828094482,\"boundaryId\":\"contoso-boundary\",\"partyId\":\"contoso-party\",\"id\":\"688f9b43-53bf-f4de-9e89-4513f3fd347b\",\"eTag\":\"0000a01d-0000-0600-0000-63f5f3fb0000\"},{\"sceneDateTime\":\"2022-01-07T00:00:00Z\",\"provider\":\"Microsoft\",\"source\":\"Sentinel_2_L2A\",\"imageFiles\":[{\"fileLink\":\"https://bb-prod-wcus-1.farmbeats.azure.net/scenes/downloadFiles?api-version=2022-11-01-preview&filePath=Microsoft%2fSentinel_2_L2A%2fcontoso-party%2fcontoso-boundary%2f2022-01-07%2f00-00-00%2fndvi_10.tif\",\"name\":\"NDVI\",\"resolution\":10.0}],\"imageFormat\":\"TIF\",\"cloudCoverPercentage\":0.0,\"darkPixelPercentage\":0.0,\"ndviMedianValue\":0.4577712118625641,\"boundaryId\":\"contoso-boundary\",\"partyId\":\"contoso-party\",\"id\":\"bfd1c194-c771-6813-628d-d4da8e519136\",\"eTag\":\"00009e1d-0000-0600-0000-63f5f3fa0000\"},{\"sceneDateTime\":\"2022-01-02T00:00:00Z\",\"provider\":\"Microsoft\",\"source\":\"Sentinel_2_L2A\",\"imageFiles\":[{\"fileLink\":\"https://bb-prod-wcus-1.farmbeats.azure.net/scenes/downloadFiles?api-version=2022-11-01-preview&filePath=Microsoft%2fSentinel_2_L2A%2fcontoso-party%2fcontoso-boundary%2f2022-01-02%2f00-00-00%2fndvi_10.tif\",\"name\":\"NDVI\",\"resolution\":10.0}],\"imageFormat\":\"TIF\",\"cloudCoverPercentage\":0.0,\"darkPixelPercentage\":0.0,\"ndviMedianValue\":0.5438882112503052,\"boundaryId\":\"contoso-boundary\",\"partyId\":\"contoso-party\",\"id\":\"49c6ae86-ac34-aa0a-9764-42a63c2dc681\",\"eTag\":\"00009d1d-0000-0600-0000-63f5f3fa0000\"}]}", - "Content-Type" : "application/json; charset=utf-8" - }, - "Exception" : null - } ], - "variables" : [ ] -} diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/swagger/README.md b/sdk/agrifood/azure-verticals-agrifood-farming/swagger/README.md deleted file mode 100644 index 622ad5c317b4..000000000000 --- a/sdk/agrifood/azure-verticals-agrifood-farming/swagger/README.md +++ /dev/null @@ -1,32 +0,0 @@ -## Generate autorest code -``` yaml -input-file: https://github.com/Azure/azure-rest-api-specs/blob/e38daec67d57ef9c4804b1e3055753407e45fa71/specification/agrifood/data-plane/Microsoft.AgFoodPlatform/preview/2022-11-01-preview/agfood.json -java: true -output-folder: ../ -namespace: com.azure.verticals.agrifood.farming -license-header: MICROSOFT_MIT_SMALL -data-plane: true -security: AADToken -security-scopes: https://farmbeats.azure.net/.default -title: FarmBeatsClient -directive: - - from: swagger-document - where: $ - transform: | - $["x-ms-parameterized-host"] = { - "hostTemplate": "{endpoint}", - "useSchemePrefix": false, - "positionInOperation": "first", - "parameters": [ - { - "name": "endpoint", - "description": "The Azure FarmBeats account endpoint.", - "required": true, - "type": "string", - "in": "path", - "x-ms-skip-url-encoding": true, - "x-ms-parameter-location": "client" - } - ] - } -``` diff --git a/sdk/agrifood/ci.yml b/sdk/agrifood/ci.yml index 7c05cf18214c..1e9fe711b078 100644 --- a/sdk/agrifood/ci.yml +++ b/sdk/agrifood/ci.yml @@ -11,7 +11,6 @@ trigger: - sdk/agrifood/ exclude: - sdk/agrifood/pom.xml - - sdk/agrifood/azure-verticals-agrifood-farming/pom.xml - sdk/agrifood/azure-resourcemanager-agrifood/pom.xml pr: @@ -26,14 +25,9 @@ pr: - sdk/agrifood/ exclude: - sdk/agrifood/pom.xml - - sdk/agrifood/azure-verticals-agrifood-farming/pom.xml - sdk/agrifood/azure-resourcemanager-agrifood/pom.xml parameters: -- name: release_azureverticalsagrifoodfarming - displayName: 'azure-verticals-agrifood-farming' - type: boolean - default: true - name: release_azureresourcemanageragrifood displayName: 'azure-resourcemanager-agrifood' type: boolean @@ -44,10 +38,6 @@ extends: parameters: ServiceDirectory: agrifood Artifacts: - - name: azure-verticals-agrifood-farming - groupId: com.azure - safeName: azureverticalsagrifoodfarming - releaseInBatch: ${{ parameters.release_azureverticalsagrifoodfarming }} - name: azure-resourcemanager-agrifood groupId: com.azure.resourcemanager safeName: azureresourcemanageragrifood diff --git a/sdk/agrifood/pom.xml b/sdk/agrifood/pom.xml index 80fb6049c045..43882458d802 100644 --- a/sdk/agrifood/pom.xml +++ b/sdk/agrifood/pom.xml @@ -10,6 +10,5 @@ 1.0.0 azure-resourcemanager-agrifood - azure-verticals-agrifood-farming