Class AttachmentsClient

java.lang.Object
com.azure.verticals.agrifood.farming.AttachmentsClient

public final class AttachmentsClient extends Object
Initializes a new instance of the synchronous FarmBeatsClient type.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>
    createOrUpdateWithResponse(String partyId, String attachmentId, com.azure.core.http.rest.RequestOptions requestOptions)
    Creates or updates an attachment resource under a particular party.
    com.azure.core.http.rest.Response<Void>
    deleteWithResponse(String partyId, String attachmentId, com.azure.core.http.rest.RequestOptions requestOptions)
    Deletes a specified attachment resource under a particular party.
    com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>
    downloadWithResponse(String partyId, String attachmentId, com.azure.core.http.rest.RequestOptions requestOptions)
    Downloads and returns attachment as response for the given input filePath.
    com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>
    getWithResponse(String partyId, String attachmentId, com.azure.core.http.rest.RequestOptions requestOptions)
    Gets a specified attachment resource under a particular party.
    com.azure.core.http.rest.PagedIterable<com.azure.core.util.BinaryData>
    listByPartyId(String partyId, com.azure.core.http.rest.RequestOptions requestOptions)
    Returns a paginated list of attachment resources under a particular party.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • listByPartyId

      public com.azure.core.http.rest.PagedIterable<com.azure.core.util.BinaryData> listByPartyId(String partyId, com.azure.core.http.rest.RequestOptions requestOptions)
      Returns a paginated list of attachment resources under a particular party.

      Query Parameters

      Query Parameters
      NameTypeRequiredDescription
      resourceIdsList<String>NoResource Ids of the resource. Call RequestOptions.addQueryParam(java.lang.String, java.lang.String) 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 RequestOptions.addQueryParam(java.lang.String, java.lang.String) to add string to array.
      idsList<String>NoIds of the resource. Call RequestOptions.addQueryParam(java.lang.String, java.lang.String) to add string to array.
      namesList<String>NoNames of the resource. Call RequestOptions.addQueryParam(java.lang.String, java.lang.String) to add string to array.
      propertyFiltersList<String>NoFilters on key-value pairs within the Properties object. eg. "{testKey} eq {testValue}". Call RequestOptions.addQueryParam(java.lang.String, java.lang.String) to add string to array.
      statusesList<String>NoStatuses of the resource. Call RequestOptions.addQueryParam(java.lang.String, java.lang.String) 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 RequestOptions.addQueryParam(java.lang.String, java.lang.String)

      Response Body Schema

      
       {
           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)
       }
       
      Parameters:
      partyId - Id of the associated party.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      paged response contains list of requested objects and a URL link to get the next set of results as paginated response with PagedIterable.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • getWithResponse

      public com.azure.core.http.rest.Response<com.azure.core.util.BinaryData> getWithResponse(String partyId, String attachmentId, com.azure.core.http.rest.RequestOptions requestOptions)
      Gets a specified attachment resource under a particular party.

      Response Body Schema

      
       {
           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)
       }
       
      Parameters:
      partyId - Id of the associated party.
      attachmentId - Id of the attachment.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      a specified attachment resource under a particular party along with Response.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • createOrUpdateWithResponse

      public com.azure.core.http.rest.Response<com.azure.core.util.BinaryData> createOrUpdateWithResponse(String partyId, String attachmentId, com.azure.core.http.rest.RequestOptions 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 RequestOptions.addHeader(java.lang.String, java.lang.String)

      Request Body Schema

      
       BinaryData
       

      Response Body Schema

      
       {
           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)
       }
       
      Parameters:
      partyId - Id of the associated party resource.
      attachmentId - Id of the attachment resource.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      schema of attachment resource along with Response.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • deleteWithResponse

      public com.azure.core.http.rest.Response<Void> deleteWithResponse(String partyId, String attachmentId, com.azure.core.http.rest.RequestOptions requestOptions)
      Deletes a specified attachment resource under a particular party.
      Parameters:
      partyId - Id of the party.
      attachmentId - Id of the attachment.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      the Response.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • downloadWithResponse

      public com.azure.core.http.rest.Response<com.azure.core.util.BinaryData> downloadWithResponse(String partyId, String attachmentId, com.azure.core.http.rest.RequestOptions requestOptions)
      Downloads and returns attachment as response for the given input filePath.

      Response Body Schema

      
       BinaryData
       
      Parameters:
      partyId - Id of the associated party.
      attachmentId - Id of attachment to be downloaded.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      the response body along with Response.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.