Skip to content

Commit

Permalink
feat: migrate models from watson developer core to java sdk core
Browse files Browse the repository at this point in the history
Migrate ACD models from IBM Watson Developer Cloud java sdk core to IBM java sdk core.  Deprecate IML java sdk methods.
  • Loading branch information
dlangst committed Mar 23, 2022
1 parent 95972ba commit 957df64
Show file tree
Hide file tree
Showing 120 changed files with 2,527 additions and 4,830 deletions.
5 changes: 0 additions & 5 deletions modules/annotator-for-clinical-data/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@
<groupId>com.ibm.cloud</groupId>
<artifactId>sdk-core</artifactId>
</dependency>
<dependency>
<groupId>com.ibm.watson.developer_cloud</groupId>
<artifactId>core</artifactId>
<version>6.14.2</version>
</dependency>
<dependency>
<groupId>com.ibm.watson.health.cognitive-services</groupId>
<artifactId>ibm-whcs-services-common</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2020.
* (C) Copyright IBM Corp. 2018, 2022.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -1162,18 +1162,16 @@ public Response<ContainerGroup> analyzeWithFlowInclResponseDetails(final String
* @return a {@link ServiceCall} with a void result
*/
public ServiceCall<Map<String, ServiceApiBean>> getAnnotators(GetAnnotatorsOptions getAnnotatorsOptions) {
String[] pathSegments = { "v1/annotators" };
RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getServiceUrl(), pathSegments));
Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("annotator_for_clinical_data_acd", "v1", "getAnnotators");
for (Entry<String, String> header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
if (getAnnotatorsOptions != null) {
builder.query("version", this.version);
}
ResponseConverter<Map<String, ServiceApiBean>> responseConverter =
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<Map<String, ServiceApiBean>>() { }.getType());
return createServiceCall(builder.build(), responseConverter);
String[] pathSegments = { "v1/annotators" };
RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getServiceUrl(), pathSegments));
Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("annotator_for_clinical_data_acd", "v1", "getAnnotators");
for (Entry<String, String> header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
builder.query("version", this.version);
ResponseConverter<Map<String, ServiceApiBean>> responseConverter =
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<Map<String, ServiceApiBean>>() { }.getType());
return createServiceCall(builder.build(), responseConverter);
}

/**
Expand Down Expand Up @@ -1226,9 +1224,7 @@ public ServiceCall<Void> deleteUserSpecificArtifacts(DeleteUserSpecificArtifacts
for (Entry<String, String> header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
if (deleteUserSpecificArtifactsOptions != null) {
builder.query("version", this.version);
}
builder.query("version", this.version);
ResponseConverter<Void> responseConverter = ResponseConverterUtils.getVoid();
return createServiceCall(builder.build(), responseConverter);
}
Expand Down Expand Up @@ -1260,9 +1256,7 @@ public ServiceCall<AcdCartridgesList> cartridgesGet(CartridgesGetOptions cartrid
builder.header(header.getKey(), header.getValue());
}
builder.header("Accept", "application/json");
if (cartridgesGetOptions != null) {
builder.query("version", this.version);
}
builder.query("version", this.version);
ResponseConverter<AcdCartridgesList> responseConverter =
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<AcdCartridgesList>() { }.getType());
return createServiceCall(builder.build(), responseConverter);
Expand Down Expand Up @@ -1323,7 +1317,7 @@ public ServiceCall<DeployCartridgeResponse> cartridgesPostMultipart() {
}

/**
* Create a cartridge deployment.
* Update an existing a cartridge deployment.
*
* Update a cartridge deployment from a cartridge archive file.
*
Expand Down Expand Up @@ -1355,7 +1349,7 @@ public ServiceCall<DeployCartridgeResponse> cartridgesPutMultipart(CartridgesPut
}

/**
* Create a cartridge deployment.
* Update an existing cartridge deployment.
*
* Update a cartridge deployment from a cartridge archive file.
*
Expand Down Expand Up @@ -1397,7 +1391,10 @@ public ServiceCall<AcdCartridges> cartridgesGetId(CartridgesGetIdOptions cartrid
*
* @param deployCartridgeOptions the {@link DeployCartridgeOptions} containing the options for the call
* @return a {@link ServiceCall} with a result of type {@link DeployCartridgeResponse}
*
* @deprecated Instead use cartridgesPostMultipart to create a new deployment or cartridgesPutMultipart to update existing deployment.
*/
@Deprecated
public ServiceCall<DeployCartridgeResponse> deployCartridge(DeployCartridgeOptions deployCartridgeOptions) {
com.ibm.cloud.sdk.core.util.Validator.notNull(deployCartridgeOptions,
"deployCartridgeOptions cannot be null");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
/*
* Copyright 2018, 2022 IBM Corp. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package com.ibm.watson.health.acd.v1.model;

import java.util.List;

import com.google.gson.annotations.SerializedName;
import com.google.gson.reflect.TypeToken;
import com.ibm.cloud.sdk.core.service.model.DynamicModel;

/**
* AllergyMedicationInd.
*/
public class AllergyMedicationInd extends DynamicModel<Object> {
@SerializedName("id")
protected String id;
@SerializedName("type")
protected String type;
@SerializedName("uid")
protected Long uid;
@SerializedName("begin")
protected Long begin;
@SerializedName("end")
protected Long end;
@SerializedName("coveredText")
protected String coveredText;
@SerializedName("negated")
protected Boolean negated;
@SerializedName("hypothetical")
protected Boolean hypothetical;
@SerializedName("medication")
protected List<MedicationAnnotation> medication;

public AllergyMedicationInd() {
super(new TypeToken<Object>() { });
}

/**
* Gets the id.
*
* @return the id
*/
public String getId() {
return this.id;
}

/**
* Gets the type.
*
* @return the type
*/
public String getType() {
return this.type;
}

/**
* Gets the uid.
*
* @return the uid
*/
public Long getUid() {
return this.uid;
}

/**
* Gets the begin.
*
* @return the begin
*/
public Long getBegin() {
return this.begin;
}

/**
* Gets the end.
*
* @return the end
*/
public Long getEnd() {
return this.end;
}

/**
* Gets the coveredText.
*
* @return the coveredText
*/
public String getCoveredText() {
return this.coveredText;
}

/**
* Gets the negated.
*
* @return the negated
*/
public Boolean isNegated() {
Boolean negated = this.negated;
if (negated == null) {
negated = false;
}
return negated;
}

/**
* Gets the hypothetical.
*
* @return the hypothetical
*/
public Boolean isHypothetical() {
Boolean hypothetical = this.hypothetical;
if (hypothetical == null) {
hypothetical = false;
}
return hypothetical;
}

/**
* Gets the medication.
*
* @return the medication
*/
public List<MedicationAnnotation> getMedication() {
return this.medication;
}
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 IBM Corp. All Rights Reserved.
* Copyright 2018, 2022 IBM Corp. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand All @@ -15,8 +15,8 @@
import java.util.ArrayList;
import java.util.List;

import com.ibm.watson.developer_cloud.service.model.GenericModel;
import com.ibm.watson.developer_cloud.util.Validator;
import com.ibm.cloud.sdk.core.service.model.GenericModel;
import com.ibm.cloud.sdk.core.util.Validator;


/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 IBM Corp. All Rights Reserved.
* Copyright 2018, 2022 IBM Corp. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand All @@ -12,8 +12,8 @@
*/
package com.ibm.watson.health.acd.v1.model;

import com.ibm.watson.developer_cloud.service.model.GenericModel;
import com.ibm.watson.developer_cloud.util.Validator;
import com.ibm.cloud.sdk.core.service.model.GenericModel;
import com.ibm.cloud.sdk.core.util.Validator;

/**
* The analyzeWithFlow options.
Expand Down
Loading

0 comments on commit 957df64

Please sign in to comment.