Class ClientBase
java.lang.Object
com.eqixiac.equinix.core.client.ClientBase
- Direct Known Subclasses:
AccessPolicyClientImpl, AgreementClientImpl, CoreClientImpl, CrossConnectClientImpl, DigitalLoasClientImpl, DiscoveryClientImpl, EffectivePermissionClientImpl, FilesClientImpl, HealthClientImpl, HierarchyClientImpl, LegacyEnvironmentalClientImpl, LegacyPowerClientImpl, LookupClientImpl, NotificationClientImpl, NotificationClientImpl, OidcProviderClientImpl, OrderHistoryClientImpl, PermissionSetClientImpl, PolicyMaskClientImpl, PortPackageClientImpl, PricingClientImpl, PrincipalPolicyClientImpl, ResourceClientBase, ResourceTypeClientImpl, RoleAssignmentClientImpl, RoleClientImpl, SecureCabinetClientImpl, ShipmentClientImpl, SmartHandsClientImpl, SmartViewAssetClientImpl, SupportCasesClientImpl, TokenClientImpl, TroubleTicketOrderClientImpl, UnifiedNotificationsClientImpl, WorkVisitClientImpl
- Author:
- ianjones
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classFluent builder for constructingEquinixRequestinstances. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedClientBase(Config configClient, String functionalArea, String requestParent) -
Method Summary
Modifier 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.
-
Constructor Details
-
ClientBase
-
-
Method Details
-
getConfigClient
-
invoke
-
newRequest
Creates a fluent request builder for the given service endpoint.EquinixRequest<Connection> request = this.newRequest("GetConnection") .withType(RequestType.SINGLE) .withPathParams(Map.of("uuid", uuid)) .withTypeRef(ConnectionJson.getSingleTypeRef()) .build();- Parameters:
serviceEndpoint- the service endpoint name from the apiParams JSON- Returns:
- a new
ClientBase.EquinixRequestBuilder
-
buildRequest
protected <T> EquinixRequest<T> buildRequest(String serviceEndpoint, RequestType requestType, Class<?> jsonClass) -
buildRequestWithPathParams
protected <T> EquinixRequest<T> buildRequestWithPathParams(String serviceEndpoint, RequestType requestType, Map<String, String> pathParams, Class<?> jsonClass) -
buildRequestWithQueryParams
protected <T> EquinixRequest<T> buildRequestWithQueryParams(String serviceEndpoint, RequestType requestType, Map<String, List<String>> queryParams, Class<?> jsonClass) -
buildRequest
-
getAs
-
getAs
-
postAs
-
postForType
-
listAs
-
postListAs
-
mapOp
-
booleanOp
-
stringOp
-
bytesOp
-
voidOp
protected void voidOp(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. Useful for update/action endpoints whose result is then re-fetched (e.g.voidOp("UpdateX", SINGLE, pathParams, null, body); return getByUuid(uuid);). -
postForType
-
postForType
-
createReturningLocationUuid
protected String createReturningLocationUuid(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). Pair withgetByUuid(...)to return the created resource.
-