Skip to content

Commit

Permalink
Merge pull request #74 from cmgrote/master
Browse files Browse the repository at this point in the history
Adds new category endpoints of v3.5
  • Loading branch information
cmgrote committed Feb 3, 2021
2 parents f2cc854 + bf8661f commit 84ef985
Show file tree
Hide file tree
Showing 19 changed files with 1,445 additions and 5 deletions.
2 changes: 1 addition & 1 deletion java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<artifactId>watson-data-api-client</artifactId>
<packaging>jar</packaging>
<name>watson-data-api-client</name>
<version>0.4</version>
<version>0.5-SNAPSHOT</version>
<url>https://github.com/IBM/watson-data-api-clients/java</url>
<description>IBM Watson Data API Java Client</description>
<scm>
Expand Down
250 changes: 250 additions & 0 deletions java/src/main/java/com/ibm/watson/data/client/api/CategoriesApiV3.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
/*
* Copyright 2020 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.data.client.model;

import java.util.Map;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.HashMap;

/**
* Artifact relationships
*/
public class ArtifactRelationships {

private String artifactId;
private String versionId;
private Map<String, PaginatedAbstractRelationshipList> relationships = null;

public ArtifactRelationships artifactId(String artifactId) {
this.artifactId = artifactId;
return this;
}

/**
* Artifact ID.
* @return artifactId
**/
@javax.annotation.Nullable
@JsonProperty("artifact_id")
@JsonInclude(value = JsonInclude.Include.NON_NULL)
public String getArtifactId() { return artifactId; }
public void setArtifactId(String artifactId) { this.artifactId = artifactId; }

public ArtifactRelationships versionId(String versionId) {
this.versionId = versionId;
return this;
}

/**
* Version ID.
* @return versionId
**/
@javax.annotation.Nullable
@JsonProperty("version_id")
@JsonInclude(value = JsonInclude.Include.NON_NULL)
public String getVersionId() { return versionId; }
public void setVersionId(String versionId) { this.versionId = versionId; }

public ArtifactRelationships relationships(Map<String, PaginatedAbstractRelationshipList> relationships) {
this.relationships = relationships;
return this;
}

public ArtifactRelationships putRelationshipsItem(String key, PaginatedAbstractRelationshipList relationshipsItem) {
if (this.relationships == null) {
this.relationships = new HashMap<>();
}
this.relationships.put(key, relationshipsItem);
return this;
}

/**
* Relationships grouped by relationship type.
* @return relationships
**/
@javax.annotation.Nullable
@JsonProperty("relationships")
@JsonInclude(value = JsonInclude.Include.NON_NULL)
public Map<String, PaginatedAbstractRelationshipList> getRelationships() { return relationships; }
public void setRelationships(Map<String, PaginatedAbstractRelationshipList> relationships) { this.relationships = relationships; }

@Override
public boolean equals(Object o) {
if (this == o) { return true; }
if (o == null || getClass() != o.getClass()) { return false; }
ArtifactRelationships that = (ArtifactRelationships) o;
return Objects.equals(this.artifactId, that.artifactId) &&
Objects.equals(this.versionId, that.versionId) &&
Objects.equals(this.relationships, that.relationships);
}

@Override
public int hashCode() {
return Objects.hash(artifactId, versionId, relationships);
}


@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ArtifactRelationships {\n");
sb.append(" artifactId: ").append(toIndentedString(artifactId)).append("\n");
sb.append(" versionId: ").append(toIndentedString(versionId)).append("\n");
sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n");
sb.append("}");
return sb.toString();
}

/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) { return "null"; }
return o.toString().replace("\n", "\n ");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*
* Copyright 2020 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.data.client.model;

import java.util.List;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;

/**
* Artifact relationship response
*/
public class ArtifactRelationshipsResponse {

private List<ArtifactRelationships> artifacts = null;

public ArtifactRelationshipsResponse artifacts(List<ArtifactRelationships> artifacts) {
this.artifacts = artifacts;
return this;
}

public ArtifactRelationshipsResponse addArtifactsItem(ArtifactRelationships artifactsItem) {
if (this.artifacts == null) {
this.artifacts = new ArrayList<>();
}
this.artifacts.add(artifactsItem);
return this;
}

/**
* List of artifact relationships.
* @return artifacts
**/
@javax.annotation.Nullable
@JsonProperty("artifacts")
@JsonInclude(value = JsonInclude.Include.NON_NULL)
public List<ArtifactRelationships> getArtifacts() { return artifacts; }
public void setArtifacts(List<ArtifactRelationships> artifacts) { this.artifacts = artifacts; }

@Override
public boolean equals(Object o) {
if (this == o) { return true; }
if (o == null || getClass() != o.getClass()) { return false; }
ArtifactRelationshipsResponse that = (ArtifactRelationshipsResponse) o;
return Objects.equals(this.artifacts, that.artifacts);
}

@Override
public int hashCode() {
return Objects.hash(artifacts);
}


@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ArtifactRelationshipsResponse {\n");
sb.append(" artifacts: ").append(toIndentedString(artifacts)).append("\n");
sb.append("}");
return sb.toString();
}

/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) { return "null"; }
return o.toString().replace("\n", "\n ");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
/*
* Copyright 2020 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.data.client.model;

import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.ibm.watson.data.client.model.enums.BootstrapState;

import java.util.ArrayList;
import java.util.List;

/**
* BootstrapStatus
*/
public class BootstrapStatus {

private BootstrapState status;
private String currentStep;
private String completionMessage;
private Integer completedRecords;
private Integer totalRecords;
private List<String> errors = null;

public BootstrapStatus status(BootstrapState status) {
this.status = status;
return this;
}

/**
* Current bootstrap status
* @return status
**/
@JsonProperty("status")
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public BootstrapState getStatus() { return status; }
public void setStatus(BootstrapState status) { this.status = status; }

public BootstrapStatus currentStep(String currentStep) {
this.currentStep = currentStep;
return this;
}

/**
* Current bootstrap activity
* @return currentStep
**/
@javax.annotation.Nullable
@JsonProperty("current_step")
@JsonInclude(value = JsonInclude.Include.NON_NULL)
public String getCurrentStep() { return currentStep; }
public void setCurrentStep(String currentStep) { this.currentStep = currentStep; }

public BootstrapStatus completionMessage(String completionMessage) {
this.completionMessage = completionMessage;
return this;
}

/**
* Overall outcome of the bootstrap process. Set once bootstrapping is finished.
* @return completionMessage
**/
@javax.annotation.Nullable
@JsonProperty("completion_message")
@JsonInclude(value = JsonInclude.Include.NON_NULL)
public String getCompletionMessage() { return completionMessage; }
public void setCompletionMessage(String completionMessage) { this.completionMessage = completionMessage; }

public BootstrapStatus completedRecords(Integer completedRecords) {
this.completedRecords = completedRecords;
return this;
}

/**
* Number of records already bootstrapped successfully
* @return completedRecords
**/
@javax.annotation.Nullable
@JsonProperty("completed_records")
@JsonInclude(value = JsonInclude.Include.NON_NULL)
public Integer getCompletedRecords() { return completedRecords; }
public void setCompletedRecords(Integer completedRecords) { this.completedRecords = completedRecords; }

public BootstrapStatus totalRecords(Integer totalRecords) {
this.totalRecords = totalRecords;
return this;
}

/**
* Total number of records to be processed by the bootstrap process
* @return totalRecords
**/
@javax.annotation.Nullable
@JsonProperty("total_records")
@JsonInclude(value = JsonInclude.Include.NON_NULL)
public Integer getTotalRecords() { return totalRecords; }
public void setTotalRecords(Integer totalRecords) { this.totalRecords = totalRecords; }

public BootstrapStatus errors(List<String> errors) {
this.errors = errors;
return this;
}

public BootstrapStatus addErrorsItem(String errorsItem) {
if (this.errors == null) {
this.errors = new ArrayList<>();
}
this.errors.add(errorsItem);
return this;
}

/**
* Bootstrap process errors
* @return errors
**/
@javax.annotation.Nullable
@JsonProperty("errors")
@JsonInclude(value = JsonInclude.Include.NON_NULL)
public List<String> getErrors() { return errors; }
public void setErrors(List<String> errors) { this.errors = errors; }

@Override
public boolean equals(Object o) {
if (this == o) { return true; }
if (o == null || getClass() != o.getClass()) { return false; }
BootstrapStatus that = (BootstrapStatus) o;
return Objects.equals(this.status, that.status) &&
Objects.equals(this.currentStep, that.currentStep) &&
Objects.equals(this.completionMessage, that.completionMessage) &&
Objects.equals(this.completedRecords, that.completedRecords) &&
Objects.equals(this.totalRecords, that.totalRecords) &&
Objects.equals(this.errors, that.errors);
}

@Override
public int hashCode() {
return Objects.hash(status, currentStep, completionMessage, completedRecords,
totalRecords, errors);
}


@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class BootstrapStatus {\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" currentStep: ").append(toIndentedString(currentStep)).append("\n");
sb.append(" completionMessage: ").append(toIndentedString(completionMessage)).append("\n");
sb.append(" completedRecords: ").append(toIndentedString(completedRecords)).append("\n");
sb.append(" totalRecords: ").append(toIndentedString(totalRecords)).append("\n");
sb.append(" errors: ").append(toIndentedString(errors)).append("\n");
sb.append("}");
return sb.toString();
}

/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) { return "null"; }
return o.toString().replace("\n", "\n ");
}

}
Loading

0 comments on commit 84ef985

Please sign in to comment.