Class BetaResourceClient<J>

java.lang.Object
com.eqixiac.equinix.core.client.ClientBase
com.eqixiac.equinix.core.client.ResourceClientBase<J,J>
com.eqixiac.equinix.fabric.beta.client.internal.BetaResourceClient<J>
Type Parameters:
J - the JSON model type
All Implemented Interfaces:
Pageable<J>, PageablePost<J>

@Beta public class BetaResourceClient<J> extends ResourceClientBase<J,J>
Internal resource client for one Fabric Beta response type. The Beta models are plain read models, so wrap(Object) is the identity and one generic client serves every family: an instance is bound to one apiParams resource group (requestParent) and one JSON model class, which is what the shared paging pipeline needs to fetch further pages of a search or list.
  • Field Details

    • FUNCTIONAL_AREA

      public static final String FUNCTIONAL_AREA
      The apiParams functional area every Beta endpoint is declared in.
      See Also:
  • Constructor Details

    • BetaResourceClient

      public BetaResourceClient(Config config, String requestParent, Class<J> type)
      Creates a client for one resource group and response type.
      Parameters:
      config - the core configuration
      requestParent - the apiParams resource group
      type - the JSON model class
  • Method Details

    • wrap

      protected J wrap(J json)
      Description copied from class: ResourceClientBase
      Wraps a JSON model into its public model type, binding this client so the returned object can refresh/delete/page itself.
      Specified by:
      wrap in class ResourceClientBase<J,J>
      Parameters:
      json - the deserialized JSON model
      Returns:
      the public model wrapper
    • one

      public J one(String endpoint, Map<String,String> pathParams, Object body)
      Sends a single-resource request (GET/POST/PUT/DELETE per apiParams), with an optional JSON body.
      Parameters:
      endpoint - the apiParams endpoint name
      pathParams - the path parameters
      body - the JSON body, or null for none
      Returns:
      the response model, or null for an empty body
    • patch

      public J patch(String endpoint, Map<String,String> pathParams, List<PatchOperation> operations, boolean jsonPatchContentType)
      Sends a PATCH of op/path/value operations.
      Parameters:
      endpoint - the apiParams endpoint name
      pathParams - the path parameters
      operations - the patch operations
      jsonPatchContentType - true for application/json-patch+json, false for application/json (as the spec declares per endpoint)
      Returns:
      the response model
    • search

      public PaginatedFilteredList<J> search(String endpoint, Map<String,String> pathParams, FilterPropertyList filter, SortPropertyList sort)
      POST search with a filter/pagination/sort body; further pages advance the body's pagination offset.
      Parameters:
      endpoint - the apiParams endpoint name
      pathParams - the path parameters (empty for top-level searches)
      filter - the filter, or null
      sort - the sort, or null
      Returns:
      the first page, lazily pageable
    • list

      public PaginatedList<J> list(String endpoint, Map<String,String> pathParams, Map<String, List<String>> queryParams)
      GET list paged with offset/limit query parameters.
      Parameters:
      endpoint - the apiParams endpoint name
      pathParams - the path parameters
      queryParams - extra query parameters, or null
      Returns:
      the first page, lazily pageable
    • bytes

      public byte[] bytes(String endpoint, Map<String,String> pathParams)
      GET returning the raw response body.
      Parameters:
      endpoint - the apiParams endpoint name
      pathParams - the path parameters
      Returns:
      the body bytes
    • multipart

      public J multipart(String endpoint, String fileField, byte[] fileBytes, String fileName, Map<String,String> textParts)
      POST a multipart/form-data body with one file part and text parts.
      Parameters:
      endpoint - the apiParams endpoint name
      fileField - the file part name
      fileBytes - the file content
      fileName - the advertised file name, or null
      textParts - the text parts (null values are skipped)
      Returns:
      the response model