-
Notifications
You must be signed in to change notification settings - Fork 533
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(discov2): add methods for new batches api
- Loading branch information
1 parent
254428b
commit 750a115
Showing
17 changed files
with
1,228 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
discovery/src/main/java/com/ibm/watson/discovery/v2/model/BatchDetails.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* (C) Copyright IBM Corp. 2024. | ||
* | ||
* 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.discovery.v2.model; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import com.ibm.cloud.sdk.core.service.model.GenericModel; | ||
import java.util.Date; | ||
|
||
/** | ||
* A batch is a set of documents that are ready for enrichment by an external application. After you | ||
* apply a webhook enrichment to a collection, and then process or upload documents to the | ||
* collection, Discovery creates a batch with a unique **batch_id**. | ||
*/ | ||
public class BatchDetails extends GenericModel { | ||
|
||
@SerializedName("batch_id") | ||
protected String batchId; | ||
|
||
protected Date created; | ||
|
||
@SerializedName("enrichment_id") | ||
protected String enrichmentId; | ||
|
||
protected BatchDetails() {} | ||
|
||
/** | ||
* Gets the batchId. | ||
* | ||
* <p>The Universally Unique Identifier (UUID) for a batch of documents. | ||
* | ||
* @return the batchId | ||
*/ | ||
public String getBatchId() { | ||
return batchId; | ||
} | ||
|
||
/** | ||
* Gets the created. | ||
* | ||
* <p>The date and time (RFC3339) that the batch was created. | ||
* | ||
* @return the created | ||
*/ | ||
public Date getCreated() { | ||
return created; | ||
} | ||
|
||
/** | ||
* Gets the enrichmentId. | ||
* | ||
* <p>The Universally Unique Identifier (UUID) for the external enrichment. | ||
* | ||
* @return the enrichmentId | ||
*/ | ||
public String getEnrichmentId() { | ||
return enrichmentId; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
125 changes: 125 additions & 0 deletions
125
discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListBatchesOptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
/* | ||
* (C) Copyright IBM Corp. 2024. | ||
* | ||
* 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.discovery.v2.model; | ||
|
||
import com.ibm.cloud.sdk.core.service.model.GenericModel; | ||
|
||
/** The listBatches options. */ | ||
public class ListBatchesOptions extends GenericModel { | ||
|
||
protected String projectId; | ||
protected String collectionId; | ||
|
||
/** Builder. */ | ||
public static class Builder { | ||
private String projectId; | ||
private String collectionId; | ||
|
||
/** | ||
* Instantiates a new Builder from an existing ListBatchesOptions instance. | ||
* | ||
* @param listBatchesOptions the instance to initialize the Builder with | ||
*/ | ||
private Builder(ListBatchesOptions listBatchesOptions) { | ||
this.projectId = listBatchesOptions.projectId; | ||
this.collectionId = listBatchesOptions.collectionId; | ||
} | ||
|
||
/** Instantiates a new builder. */ | ||
public Builder() {} | ||
|
||
/** | ||
* Instantiates a new builder with required properties. | ||
* | ||
* @param projectId the projectId | ||
* @param collectionId the collectionId | ||
*/ | ||
public Builder(String projectId, String collectionId) { | ||
this.projectId = projectId; | ||
this.collectionId = collectionId; | ||
} | ||
|
||
/** | ||
* Builds a ListBatchesOptions. | ||
* | ||
* @return the new ListBatchesOptions instance | ||
*/ | ||
public ListBatchesOptions build() { | ||
return new ListBatchesOptions(this); | ||
} | ||
|
||
/** | ||
* Set the projectId. | ||
* | ||
* @param projectId the projectId | ||
* @return the ListBatchesOptions builder | ||
*/ | ||
public Builder projectId(String projectId) { | ||
this.projectId = projectId; | ||
return this; | ||
} | ||
|
||
/** | ||
* Set the collectionId. | ||
* | ||
* @param collectionId the collectionId | ||
* @return the ListBatchesOptions builder | ||
*/ | ||
public Builder collectionId(String collectionId) { | ||
this.collectionId = collectionId; | ||
return this; | ||
} | ||
} | ||
|
||
protected ListBatchesOptions() {} | ||
|
||
protected ListBatchesOptions(Builder builder) { | ||
com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.projectId, "projectId cannot be empty"); | ||
com.ibm.cloud.sdk.core.util.Validator.notEmpty( | ||
builder.collectionId, "collectionId cannot be empty"); | ||
projectId = builder.projectId; | ||
collectionId = builder.collectionId; | ||
} | ||
|
||
/** | ||
* New builder. | ||
* | ||
* @return a ListBatchesOptions builder | ||
*/ | ||
public Builder newBuilder() { | ||
return new Builder(this); | ||
} | ||
|
||
/** | ||
* Gets the projectId. | ||
* | ||
* <p>The Universally Unique Identifier (UUID) of the project. This information can be found from | ||
* the *Integrate and Deploy* page in Discovery. | ||
* | ||
* @return the projectId | ||
*/ | ||
public String projectId() { | ||
return projectId; | ||
} | ||
|
||
/** | ||
* Gets the collectionId. | ||
* | ||
* <p>The Universally Unique Identifier (UUID) of the collection. | ||
* | ||
* @return the collectionId | ||
*/ | ||
public String collectionId() { | ||
return collectionId; | ||
} | ||
} |
Oops, something went wrong.