Skip to content

Commit 84ef985

Browse files
authored
Merge pull request #74 from cmgrote/master
Adds new category endpoints of v3.5
2 parents f2cc854 + bf8661f commit 84ef985

File tree

19 files changed

+1445
-5
lines changed

19 files changed

+1445
-5
lines changed

java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<artifactId>watson-data-api-client</artifactId>
2222
<packaging>jar</packaging>
2323
<name>watson-data-api-client</name>
24-
<version>0.4</version>
24+
<version>0.5-SNAPSHOT</version>
2525
<url>https://github.com/IBM/watson-data-api-clients/java</url>
2626
<description>IBM Watson Data API Java Client</description>
2727
<scm>

java/src/main/java/com/ibm/watson/data/client/api/CategoriesApiV3.java

Lines changed: 250 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
/*
2+
* Copyright 2020 IBM Corp. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.ibm.watson.data.client.model;
17+
18+
import java.util.Map;
19+
import java.util.Objects;
20+
import com.fasterxml.jackson.annotation.JsonInclude;
21+
import com.fasterxml.jackson.annotation.JsonProperty;
22+
import java.util.HashMap;
23+
24+
/**
25+
* Artifact relationships
26+
*/
27+
public class ArtifactRelationships {
28+
29+
private String artifactId;
30+
private String versionId;
31+
private Map<String, PaginatedAbstractRelationshipList> relationships = null;
32+
33+
public ArtifactRelationships artifactId(String artifactId) {
34+
this.artifactId = artifactId;
35+
return this;
36+
}
37+
38+
/**
39+
* Artifact ID.
40+
* @return artifactId
41+
**/
42+
@javax.annotation.Nullable
43+
@JsonProperty("artifact_id")
44+
@JsonInclude(value = JsonInclude.Include.NON_NULL)
45+
public String getArtifactId() { return artifactId; }
46+
public void setArtifactId(String artifactId) { this.artifactId = artifactId; }
47+
48+
public ArtifactRelationships versionId(String versionId) {
49+
this.versionId = versionId;
50+
return this;
51+
}
52+
53+
/**
54+
* Version ID.
55+
* @return versionId
56+
**/
57+
@javax.annotation.Nullable
58+
@JsonProperty("version_id")
59+
@JsonInclude(value = JsonInclude.Include.NON_NULL)
60+
public String getVersionId() { return versionId; }
61+
public void setVersionId(String versionId) { this.versionId = versionId; }
62+
63+
public ArtifactRelationships relationships(Map<String, PaginatedAbstractRelationshipList> relationships) {
64+
this.relationships = relationships;
65+
return this;
66+
}
67+
68+
public ArtifactRelationships putRelationshipsItem(String key, PaginatedAbstractRelationshipList relationshipsItem) {
69+
if (this.relationships == null) {
70+
this.relationships = new HashMap<>();
71+
}
72+
this.relationships.put(key, relationshipsItem);
73+
return this;
74+
}
75+
76+
/**
77+
* Relationships grouped by relationship type.
78+
* @return relationships
79+
**/
80+
@javax.annotation.Nullable
81+
@JsonProperty("relationships")
82+
@JsonInclude(value = JsonInclude.Include.NON_NULL)
83+
public Map<String, PaginatedAbstractRelationshipList> getRelationships() { return relationships; }
84+
public void setRelationships(Map<String, PaginatedAbstractRelationshipList> relationships) { this.relationships = relationships; }
85+
86+
@Override
87+
public boolean equals(Object o) {
88+
if (this == o) { return true; }
89+
if (o == null || getClass() != o.getClass()) { return false; }
90+
ArtifactRelationships that = (ArtifactRelationships) o;
91+
return Objects.equals(this.artifactId, that.artifactId) &&
92+
Objects.equals(this.versionId, that.versionId) &&
93+
Objects.equals(this.relationships, that.relationships);
94+
}
95+
96+
@Override
97+
public int hashCode() {
98+
return Objects.hash(artifactId, versionId, relationships);
99+
}
100+
101+
102+
@Override
103+
public String toString() {
104+
StringBuilder sb = new StringBuilder();
105+
sb.append("class ArtifactRelationships {\n");
106+
sb.append(" artifactId: ").append(toIndentedString(artifactId)).append("\n");
107+
sb.append(" versionId: ").append(toIndentedString(versionId)).append("\n");
108+
sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n");
109+
sb.append("}");
110+
return sb.toString();
111+
}
112+
113+
/**
114+
* Convert the given object to string with each line indented by 4 spaces
115+
* (except the first line).
116+
*/
117+
private String toIndentedString(Object o) {
118+
if (o == null) { return "null"; }
119+
return o.toString().replace("\n", "\n ");
120+
}
121+
122+
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/*
2+
* Copyright 2020 IBM Corp. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.ibm.watson.data.client.model;
17+
18+
import java.util.List;
19+
import java.util.Objects;
20+
import com.fasterxml.jackson.annotation.JsonInclude;
21+
import com.fasterxml.jackson.annotation.JsonProperty;
22+
import java.util.ArrayList;
23+
24+
/**
25+
* Artifact relationship response
26+
*/
27+
public class ArtifactRelationshipsResponse {
28+
29+
private List<ArtifactRelationships> artifacts = null;
30+
31+
public ArtifactRelationshipsResponse artifacts(List<ArtifactRelationships> artifacts) {
32+
this.artifacts = artifacts;
33+
return this;
34+
}
35+
36+
public ArtifactRelationshipsResponse addArtifactsItem(ArtifactRelationships artifactsItem) {
37+
if (this.artifacts == null) {
38+
this.artifacts = new ArrayList<>();
39+
}
40+
this.artifacts.add(artifactsItem);
41+
return this;
42+
}
43+
44+
/**
45+
* List of artifact relationships.
46+
* @return artifacts
47+
**/
48+
@javax.annotation.Nullable
49+
@JsonProperty("artifacts")
50+
@JsonInclude(value = JsonInclude.Include.NON_NULL)
51+
public List<ArtifactRelationships> getArtifacts() { return artifacts; }
52+
public void setArtifacts(List<ArtifactRelationships> artifacts) { this.artifacts = artifacts; }
53+
54+
@Override
55+
public boolean equals(Object o) {
56+
if (this == o) { return true; }
57+
if (o == null || getClass() != o.getClass()) { return false; }
58+
ArtifactRelationshipsResponse that = (ArtifactRelationshipsResponse) o;
59+
return Objects.equals(this.artifacts, that.artifacts);
60+
}
61+
62+
@Override
63+
public int hashCode() {
64+
return Objects.hash(artifacts);
65+
}
66+
67+
68+
@Override
69+
public String toString() {
70+
StringBuilder sb = new StringBuilder();
71+
sb.append("class ArtifactRelationshipsResponse {\n");
72+
sb.append(" artifacts: ").append(toIndentedString(artifacts)).append("\n");
73+
sb.append("}");
74+
return sb.toString();
75+
}
76+
77+
/**
78+
* Convert the given object to string with each line indented by 4 spaces
79+
* (except the first line).
80+
*/
81+
private String toIndentedString(Object o) {
82+
if (o == null) { return "null"; }
83+
return o.toString().replace("\n", "\n ");
84+
}
85+
86+
}
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
/*
2+
* Copyright 2020 IBM Corp. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.ibm.watson.data.client.model;
17+
18+
import java.util.Objects;
19+
import com.fasterxml.jackson.annotation.JsonInclude;
20+
import com.fasterxml.jackson.annotation.JsonProperty;
21+
import com.ibm.watson.data.client.model.enums.BootstrapState;
22+
23+
import java.util.ArrayList;
24+
import java.util.List;
25+
26+
/**
27+
* BootstrapStatus
28+
*/
29+
public class BootstrapStatus {
30+
31+
private BootstrapState status;
32+
private String currentStep;
33+
private String completionMessage;
34+
private Integer completedRecords;
35+
private Integer totalRecords;
36+
private List<String> errors = null;
37+
38+
public BootstrapStatus status(BootstrapState status) {
39+
this.status = status;
40+
return this;
41+
}
42+
43+
/**
44+
* Current bootstrap status
45+
* @return status
46+
**/
47+
@JsonProperty("status")
48+
@JsonInclude(value = JsonInclude.Include.ALWAYS)
49+
public BootstrapState getStatus() { return status; }
50+
public void setStatus(BootstrapState status) { this.status = status; }
51+
52+
public BootstrapStatus currentStep(String currentStep) {
53+
this.currentStep = currentStep;
54+
return this;
55+
}
56+
57+
/**
58+
* Current bootstrap activity
59+
* @return currentStep
60+
**/
61+
@javax.annotation.Nullable
62+
@JsonProperty("current_step")
63+
@JsonInclude(value = JsonInclude.Include.NON_NULL)
64+
public String getCurrentStep() { return currentStep; }
65+
public void setCurrentStep(String currentStep) { this.currentStep = currentStep; }
66+
67+
public BootstrapStatus completionMessage(String completionMessage) {
68+
this.completionMessage = completionMessage;
69+
return this;
70+
}
71+
72+
/**
73+
* Overall outcome of the bootstrap process. Set once bootstrapping is finished.
74+
* @return completionMessage
75+
**/
76+
@javax.annotation.Nullable
77+
@JsonProperty("completion_message")
78+
@JsonInclude(value = JsonInclude.Include.NON_NULL)
79+
public String getCompletionMessage() { return completionMessage; }
80+
public void setCompletionMessage(String completionMessage) { this.completionMessage = completionMessage; }
81+
82+
public BootstrapStatus completedRecords(Integer completedRecords) {
83+
this.completedRecords = completedRecords;
84+
return this;
85+
}
86+
87+
/**
88+
* Number of records already bootstrapped successfully
89+
* @return completedRecords
90+
**/
91+
@javax.annotation.Nullable
92+
@JsonProperty("completed_records")
93+
@JsonInclude(value = JsonInclude.Include.NON_NULL)
94+
public Integer getCompletedRecords() { return completedRecords; }
95+
public void setCompletedRecords(Integer completedRecords) { this.completedRecords = completedRecords; }
96+
97+
public BootstrapStatus totalRecords(Integer totalRecords) {
98+
this.totalRecords = totalRecords;
99+
return this;
100+
}
101+
102+
/**
103+
* Total number of records to be processed by the bootstrap process
104+
* @return totalRecords
105+
**/
106+
@javax.annotation.Nullable
107+
@JsonProperty("total_records")
108+
@JsonInclude(value = JsonInclude.Include.NON_NULL)
109+
public Integer getTotalRecords() { return totalRecords; }
110+
public void setTotalRecords(Integer totalRecords) { this.totalRecords = totalRecords; }
111+
112+
public BootstrapStatus errors(List<String> errors) {
113+
this.errors = errors;
114+
return this;
115+
}
116+
117+
public BootstrapStatus addErrorsItem(String errorsItem) {
118+
if (this.errors == null) {
119+
this.errors = new ArrayList<>();
120+
}
121+
this.errors.add(errorsItem);
122+
return this;
123+
}
124+
125+
/**
126+
* Bootstrap process errors
127+
* @return errors
128+
**/
129+
@javax.annotation.Nullable
130+
@JsonProperty("errors")
131+
@JsonInclude(value = JsonInclude.Include.NON_NULL)
132+
public List<String> getErrors() { return errors; }
133+
public void setErrors(List<String> errors) { this.errors = errors; }
134+
135+
@Override
136+
public boolean equals(Object o) {
137+
if (this == o) { return true; }
138+
if (o == null || getClass() != o.getClass()) { return false; }
139+
BootstrapStatus that = (BootstrapStatus) o;
140+
return Objects.equals(this.status, that.status) &&
141+
Objects.equals(this.currentStep, that.currentStep) &&
142+
Objects.equals(this.completionMessage, that.completionMessage) &&
143+
Objects.equals(this.completedRecords, that.completedRecords) &&
144+
Objects.equals(this.totalRecords, that.totalRecords) &&
145+
Objects.equals(this.errors, that.errors);
146+
}
147+
148+
@Override
149+
public int hashCode() {
150+
return Objects.hash(status, currentStep, completionMessage, completedRecords,
151+
totalRecords, errors);
152+
}
153+
154+
155+
@Override
156+
public String toString() {
157+
StringBuilder sb = new StringBuilder();
158+
sb.append("class BootstrapStatus {\n");
159+
sb.append(" status: ").append(toIndentedString(status)).append("\n");
160+
sb.append(" currentStep: ").append(toIndentedString(currentStep)).append("\n");
161+
sb.append(" completionMessage: ").append(toIndentedString(completionMessage)).append("\n");
162+
sb.append(" completedRecords: ").append(toIndentedString(completedRecords)).append("\n");
163+
sb.append(" totalRecords: ").append(toIndentedString(totalRecords)).append("\n");
164+
sb.append(" errors: ").append(toIndentedString(errors)).append("\n");
165+
sb.append("}");
166+
return sb.toString();
167+
}
168+
169+
/**
170+
* Convert the given object to string with each line indented by 4 spaces
171+
* (except the first line).
172+
*/
173+
private String toIndentedString(Object o) {
174+
if (o == null) { return "null"; }
175+
return o.toString().replace("\n", "\n ");
176+
}
177+
178+
}

0 commit comments

Comments
 (0)