+ /**
+ * Construct cloudConfiguration for the SO requestDetails.
+ *
+ * @param tenantItem tenant item from A&AI named-query response
+ * @return SO cloud configuration
+ */
+ protected SoCloudConfiguration constructCloudConfiguration(Tenant tenantItem, CloudRegion cloudRegionItem) {
+ var cloudConfiguration = new SoCloudConfiguration();
+ cloudConfiguration.setTenantId(getRequiredText("tenant ID", tenantItem.getTenantId()));
+ cloudConfiguration.setLcpCloudRegionId(getRequiredText("cloud region ID", cloudRegionItem.getCloudRegionId()));
+ return cloudConfiguration;
+ }
+
+ /**
+ * Verifies that a value is not {@code null}.
+ *
+ * @param name value name
+ * @param value value to check
+ * @return the value
+ */
+ protected String getRequiredText(String name, String value) {
+ if (value == null) {
+ throw new IllegalArgumentException("missing " + name);
+ }
+
+ return value;
+ }
+
+ /**
+ * Create simple HTTP headers for unauthenticated requests to SO.
+ *
+ * @return the HTTP headers
+ */
+ protected Map<String, Object> createSimpleHeaders() {
+ Map<String, Object> headers = new HashMap<>();
+ headers.put("Accept", MediaType.APPLICATION_JSON);
+ return headers;
+ }
+