-
Notifications
You must be signed in to change notification settings - Fork 532
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Visual Recognition v4): Add getTrainingUsage method
- Loading branch information
Showing
4 changed files
with
357 additions
and
5 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
113 changes: 113 additions & 0 deletions
113
...ion/src/main/java/com/ibm/watson/visual_recognition/v4/model/GetTrainingUsageOptions.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,113 @@ | ||
/* | ||
* (C) Copyright IBM Corp. 2019. | ||
* | ||
* 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.visual_recognition.v4.model; | ||
|
||
import java.util.Date; | ||
|
||
import com.ibm.cloud.sdk.core.service.model.GenericModel; | ||
|
||
/** | ||
* The getTrainingUsage options. | ||
*/ | ||
public class GetTrainingUsageOptions extends GenericModel { | ||
|
||
private Date startTime; | ||
private Date endTime; | ||
|
||
/** | ||
* Builder. | ||
*/ | ||
public static class Builder { | ||
private Date startTime; | ||
private Date endTime; | ||
|
||
private Builder(GetTrainingUsageOptions getTrainingUsageOptions) { | ||
this.startTime = getTrainingUsageOptions.startTime; | ||
this.endTime = getTrainingUsageOptions.endTime; | ||
} | ||
|
||
/** | ||
* Instantiates a new builder. | ||
*/ | ||
public Builder() { | ||
} | ||
|
||
/** | ||
* Builds a GetTrainingUsageOptions. | ||
* | ||
* @return the getTrainingUsageOptions | ||
*/ | ||
public GetTrainingUsageOptions build() { | ||
return new GetTrainingUsageOptions(this); | ||
} | ||
|
||
/** | ||
* Set the startTime. | ||
* | ||
* @param startTime the startTime | ||
* @return the GetTrainingUsageOptions builder | ||
*/ | ||
public Builder startTime(Date startTime) { | ||
this.startTime = startTime; | ||
return this; | ||
} | ||
|
||
/** | ||
* Set the endTime. | ||
* | ||
* @param endTime the endTime | ||
* @return the GetTrainingUsageOptions builder | ||
*/ | ||
public Builder endTime(Date endTime) { | ||
this.endTime = endTime; | ||
return this; | ||
} | ||
} | ||
|
||
private GetTrainingUsageOptions(Builder builder) { | ||
startTime = builder.startTime; | ||
endTime = builder.endTime; | ||
} | ||
|
||
/** | ||
* New builder. | ||
* | ||
* @return a GetTrainingUsageOptions builder | ||
*/ | ||
public Builder newBuilder() { | ||
return new Builder(this); | ||
} | ||
|
||
/** | ||
* Gets the startTime. | ||
* | ||
* The earliest day to include training events. If empty or not specified, the earliest training event is included. | ||
* | ||
* @return the startTime | ||
*/ | ||
public Date startTime() { | ||
return startTime; | ||
} | ||
|
||
/** | ||
* Gets the endTime. | ||
* | ||
* The most recent day to include training events. All events for the day are included. If empty or not specified, the | ||
* current day is used. Specify the same value as `start_time` to request events for a single day. | ||
* | ||
* @return the endTime | ||
*/ | ||
public Date endTime() { | ||
return endTime; | ||
} | ||
} |
106 changes: 106 additions & 0 deletions
106
...l-recognition/src/main/java/com/ibm/watson/visual_recognition/v4/model/TrainingEvent.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,106 @@ | ||
/* | ||
* (C) Copyright IBM Corp. 2019. | ||
* | ||
* 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.visual_recognition.v4.model; | ||
|
||
import java.util.Date; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import com.ibm.cloud.sdk.core.service.model.GenericModel; | ||
|
||
/** | ||
* Details about the training event. | ||
*/ | ||
public class TrainingEvent extends GenericModel { | ||
|
||
/** | ||
* Trained object type. Only `objects` is currently supported. | ||
*/ | ||
public interface Type { | ||
/** objects. */ | ||
String OBJECTS = "objects"; | ||
} | ||
|
||
/** | ||
* Training status of the training event. | ||
*/ | ||
public interface Status { | ||
/** failed. */ | ||
String FAILED = "failed"; | ||
/** succeeded. */ | ||
String SUCCEEDED = "succeeded"; | ||
} | ||
|
||
private String type; | ||
@SerializedName("collection_id") | ||
private String collectionId; | ||
@SerializedName("completion_time") | ||
private Date completionTime; | ||
private String status; | ||
@SerializedName("image_count") | ||
private Long imageCount; | ||
|
||
/** | ||
* Gets the type. | ||
* | ||
* Trained object type. Only `objects` is currently supported. | ||
* | ||
* @return the type | ||
*/ | ||
public String getType() { | ||
return type; | ||
} | ||
|
||
/** | ||
* Gets the collectionId. | ||
* | ||
* Identifier of the trained collection. | ||
* | ||
* @return the collectionId | ||
*/ | ||
public String getCollectionId() { | ||
return collectionId; | ||
} | ||
|
||
/** | ||
* Gets the completionTime. | ||
* | ||
* Date and time in Coordinated Universal Time (UTC) that training on the collection finished. | ||
* | ||
* @return the completionTime | ||
*/ | ||
public Date getCompletionTime() { | ||
return completionTime; | ||
} | ||
|
||
/** | ||
* Gets the status. | ||
* | ||
* Training status of the training event. | ||
* | ||
* @return the status | ||
*/ | ||
public String getStatus() { | ||
return status; | ||
} | ||
|
||
/** | ||
* Gets the imageCount. | ||
* | ||
* The total number of images that were used in training for this training event. | ||
* | ||
* @return the imageCount | ||
*/ | ||
public Long getImageCount() { | ||
return imageCount; | ||
} | ||
} |
92 changes: 92 additions & 0 deletions
92
...-recognition/src/main/java/com/ibm/watson/visual_recognition/v4/model/TrainingEvents.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,92 @@ | ||
/* | ||
* (C) Copyright IBM Corp. 2019. | ||
* | ||
* 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.visual_recognition.v4.model; | ||
|
||
import java.util.Date; | ||
import java.util.List; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import com.ibm.cloud.sdk.core.service.model.GenericModel; | ||
|
||
/** | ||
* Details about the training events. | ||
*/ | ||
public class TrainingEvents extends GenericModel { | ||
|
||
@SerializedName("start_time") | ||
private Date startTime; | ||
@SerializedName("end_time") | ||
private Date endTime; | ||
@SerializedName("completed_events") | ||
private Long completedEvents; | ||
@SerializedName("trained_images") | ||
private Long trainedImages; | ||
private List<TrainingEvent> events; | ||
|
||
/** | ||
* Gets the startTime. | ||
* | ||
* The starting day for the returned training events in Coordinated Universal Time (UTC). If not specified in the | ||
* request, it identifies the earliest training event. | ||
* | ||
* @return the startTime | ||
*/ | ||
public Date getStartTime() { | ||
return startTime; | ||
} | ||
|
||
/** | ||
* Gets the endTime. | ||
* | ||
* The ending day for the returned training events in Coordinated Universal Time (UTC). If not specified in the | ||
* request, it lists the current time. | ||
* | ||
* @return the endTime | ||
*/ | ||
public Date getEndTime() { | ||
return endTime; | ||
} | ||
|
||
/** | ||
* Gets the completedEvents. | ||
* | ||
* The total number of training events in the response for the start and end times. | ||
* | ||
* @return the completedEvents | ||
*/ | ||
public Long getCompletedEvents() { | ||
return completedEvents; | ||
} | ||
|
||
/** | ||
* Gets the trainedImages. | ||
* | ||
* The total number of images that were used in training for the start and end times. | ||
* | ||
* @return the trainedImages | ||
*/ | ||
public Long getTrainedImages() { | ||
return trainedImages; | ||
} | ||
|
||
/** | ||
* Gets the events. | ||
* | ||
* The completed training events for the start and end time. | ||
* | ||
* @return the events | ||
*/ | ||
public List<TrainingEvent> getEvents() { | ||
return events; | ||
} | ||
} |