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>
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.-
Nested Class Summary
Nested classes/interfaces inherited from class ClientBase
ClientBase.EquinixRequestBuilderModifier and TypeClassDescriptionprotected classFluent builder for constructingEquinixRequestinstances. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe apiParams functional area every Beta endpoint is declared in. -
Constructor Summary
ConstructorsConstructorDescriptionBetaResourceClient(Config config, String requestParent, Class<J> type) Creates a client for one resource group and response type. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]GET returning the raw response body.GET list paged withoffset/limitquery parameters.multipart(String endpoint, String fileField, byte[] fileBytes, String fileName, Map<String, String> textParts) POST amultipart/form-databody with one file part and text parts.Sends a single-resource request (GET/POST/PUT/DELETE per apiParams), with an optional JSON body.patch(String endpoint, Map<String, String> pathParams, List<PatchOperation> operations, boolean jsonPatchContentType) Sends a PATCH ofop/path/valueoperations.search(String endpoint, Map<String, String> pathParams, FilterPropertyList filter, SortPropertyList sort) POST search with afilter/pagination/sortbody; further pages advance the body's pagination offset.protected JWraps a JSON model into its public model type, binding this client so the returned object can refresh/delete/page itself.Methods inherited from class ResourceClientBase
createOne, deleteOne, deleteOne, deleteOneByUuid, dryRunCreate, dryRunCreate, dryRunPatch, dryRunUpdate, getOne, getOne, getOneByUuid, listPage, listPage, listPage, listPagePath, nextPage, nextPage, patchOne, patchOne, postOne, postOne, postOne, searchPage, searchPage, searchPageQueryPaginated, searchPageQueryPaginated, updateOne, updateOne, updateOneByUuidModifier and TypeMethodDescriptionprotected Jcreate(body)via the derivedCreate<Singular>endpoint name.protected Jprotected Jprotected JdeleteOneByUuid(String uuid) delete(uuid)via the derivedDelete<Singular>endpoint name.protected JdryRunCreate(String serviceEndpoint, Object body) protected JdryRunCreate(String serviceEndpoint, Object body, com.fasterxml.jackson.databind.ser.FilterProvider filters) protected JdryRunPatch(String serviceEndpoint, String uuid, List<PatchOperation> operations) Dry-run variant ofResourceClientBase.patchOne(String, String, List): sends the identical RFC 6902 JSON Patch request (sameapplication/json-patch+jsoncontent type) plus thedryRun=truequery parameter - per the spec, an "option to verify that API calls will succeed".protected JdryRunUpdate(String serviceEndpoint, String uuid, Object body) Dry-run variant ofResourceClientBase.updateOne(String, String, Object): sends the identical update request (same defaultapplication/jsoncontent type) plus thedryRun=truequery parameter - per the spec, an "option to verify that API calls will succeed".protected Jprotected Jprotected JgetOneByUuid(String uuid) get(uuid)via the derivedGet<Singular>endpoint name.listPage()list()via the derivedList<Plural>endpoint name.listPagePath(String serviceEndpoint, Map<String, String> pathParams) nextPage(PaginatedPostRequest<J> equinixRequest) Fetches the next page for the given POST-search request (its body's pagination has already been advanced by the paging pipeline).nextPage(PaginatedRequest<J> equinixRequest) protected JpatchOne(String serviceEndpoint, String uuid, List<PatchOperation> operations) PATCH a resource by uuid with an RFC 6902 JSON Patch operations array, sent with content-typeapplication/json-patch+json.protected Jprotected Jprotected JpostOne(String serviceEndpoint, Object body, com.fasterxml.jackson.databind.ser.FilterProvider filters) protected JsearchPage(Object filterSortBody) search(body)via the derivedSearch<Plural>endpoint name.searchPage(String serviceEndpoint, Object filterSortBody) searchPageQueryPaginated(String serviceEndpoint, Object filterBody) POST search whose pagination travels asoffset/limitquery parameters (per the endpoint's spec) rather than inside the body - e.g. assets v1 and the EIA services/prices searches.searchPageQueryPaginated(String serviceEndpoint, Map<String, List<String>> queryParams, Object filterBody) Variant ofResourceClientBase.searchPageQueryPaginated(String, Object)carrying additional query parameters (e.g.protected Jprotected Jprotected JupdateOneByUuid(String uuid, Object body) update(uuid, body)via the derivedUpdate<Singular>endpoint name.Methods inherited from class ClientBase
booleanOp, buildRequest, buildRequest, buildRequestWithPathParams, buildRequestWithQueryParams, bytesOp, createReturningLocationUuid, getAs, getAs, getConfigClient, invoke, listAs, mapOp, newRequest, postAs, postForType, postForType, postForType, postListAs, stringOp, voidOpModifier and TypeMethodDescriptionprotected booleanbooleanOp(String serviceEndpoint, RequestType requestType, Map<String, String> pathParams, Map<String, List<String>> queryParams, Object body) protected <T> EquinixRequest<T> buildRequest(String serviceEndpoint, RequestType requestType, Class<?> jsonClass) protected <T> EquinixRequest<T> buildRequest(String serviceEndpoint, RequestType requestType, Map<String, String> pathParams, Map<String, List<String>> queryParams, Class<?> jsonClass) protected <T> EquinixRequest<T> buildRequestWithPathParams(String serviceEndpoint, RequestType requestType, Map<String, String> pathParams, Class<?> jsonClass) protected <T> EquinixRequest<T> buildRequestWithQueryParams(String serviceEndpoint, RequestType requestType, Map<String, List<String>> queryParams, Class<?> jsonClass) protected byte[]bytesOp(String serviceEndpoint, Map<String, String> pathParams, Map<String, List<String>> queryParams) protected StringcreateReturningLocationUuid(String serviceEndpoint, Map<String, String> pathParams, Map<String, List<String>> queryParams, Object body) POST a body, then return the created resource's uuid parsed from the responseLocationheader (for endpoints that return201 Location: .../{uuid}rather than a body).protected <R> Rprotected <R> RgetAs(String serviceEndpoint, Map<String, String> pathParams, Map<String, List<String>> queryParams, Class<R> responseType) protected Configprotected <T> EquinixResponse<T> invoke(EquinixRequest<T> equinixRequest) protected <R> List<R> listAs(String serviceEndpoint, Map<String, String> pathParams, Map<String, List<String>> queryParams, Class<R> elementType) mapOp(String serviceEndpoint, RequestType requestType, Map<String, String> pathParams, Map<String, List<String>> queryParams, Object body) protected ClientBase.EquinixRequestBuildernewRequest(String serviceEndpoint) Creates a fluent request builder for the given service endpoint.protected <R> Rprotected <R> RpostForType(String serviceEndpoint, Object body, com.fasterxml.jackson.core.type.TypeReference<?> typeReference) protected <R> RpostForType(String serviceEndpoint, Map<String, String> pathParams, Object body, com.fasterxml.jackson.core.type.TypeReference<?> typeReference) protected <R> RpostForType(String serviceEndpoint, Map<String, String> pathParams, Map<String, List<String>> queryParams, Object body, com.fasterxml.jackson.core.type.TypeReference<?> typeReference) protected <R> List<R> postListAs(String serviceEndpoint, Object body, Class<R> elementType) protected StringstringOp(String serviceEndpoint, RequestType requestType, Map<String, String> pathParams, Map<String, List<String>> queryParams, Object body) protected voidvoidOp(String serviceEndpoint, RequestType requestType, Map<String, String> pathParams, Map<String, List<String>> queryParams, Object body) Execute a request for its side effect only - the response body is validated (throws on API error) and discarded.
-
Field Details
-
FUNCTIONAL_AREA
The apiParams functional area every Beta endpoint is declared in.- See Also:
-
-
Constructor Details
-
BetaResourceClient
-
-
Method Details
-
wrap
Description copied from class:ResourceClientBaseWraps a JSON model into its public model type, binding this client so the returned object can refresh/delete/page itself.- Specified by:
wrapin classResourceClientBase<J,J> - Parameters:
json- the deserialized JSON model- Returns:
- the public model wrapper
-
one
Sends a single-resource request (GET/POST/PUT/DELETE per apiParams), with an optional JSON body.- Parameters:
endpoint- the apiParams endpoint namepathParams- the path parametersbody- the JSON body, ornullfor none- Returns:
- the response model, or
nullfor an empty body
-
patch
public J patch(String endpoint, Map<String, String> pathParams, List<PatchOperation> operations, boolean jsonPatchContentType) Sends a PATCH ofop/path/valueoperations.- Parameters:
endpoint- the apiParams endpoint namepathParams- the path parametersoperations- the patch operationsjsonPatchContentType-trueforapplication/json-patch+json,falseforapplication/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 afilter/pagination/sortbody; further pages advance the body's pagination offset.- Parameters:
endpoint- the apiParams endpoint namepathParams- the path parameters (empty for top-level searches)filter- the filter, ornullsort- the sort, ornull- 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 withoffset/limitquery parameters.- Parameters:
endpoint- the apiParams endpoint namepathParams- the path parametersqueryParams- extra query parameters, ornull- Returns:
- the first page, lazily pageable
-
bytes
-
multipart
public J multipart(String endpoint, String fileField, byte[] fileBytes, String fileName, Map<String, String> textParts) POST amultipart/form-databody with one file part and text parts.- Parameters:
endpoint- the apiParams endpoint namefileField- the file part namefileBytes- the file contentfileName- the advertised file name, ornulltextParts- the text parts (null values are skipped)- Returns:
- the response model
-