Skip to content

Commit

Permalink
feat(assistantv1): update models and add new methods
Browse files Browse the repository at this point in the history
NEW methods: createWorkspaceAsync, updateWorkspaceAsync, exportWorkspaceAsync
  • Loading branch information
apaparazzi0329 committed Aug 10, 2022
1 parent cac83a5 commit 64a2622
Show file tree
Hide file tree
Showing 10 changed files with 1,700 additions and 15 deletions.
278 changes: 277 additions & 1 deletion assistant/src/main/java/com/ibm/watson/assistant/v1/Assistant.java

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
/*
* (C) Copyright IBM Corp. 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
*
* 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.assistant.v1.model;

import com.ibm.cloud.sdk.core.service.model.GenericModel;

/** The exportWorkspaceAsync options. */
public class ExportWorkspaceAsyncOptions extends GenericModel {

/**
* Indicates how the returned workspace data will be sorted. Specify `sort=stable` to sort all
* workspace objects by unique identifier, in ascending alphabetical order.
*/
public interface Sort {
/** stable. */
String STABLE = "stable";
}

protected String workspaceId;
protected Boolean includeAudit;
protected String sort;
protected Boolean verbose;

/** Builder. */
public static class Builder {
private String workspaceId;
private Boolean includeAudit;
private String sort;
private Boolean verbose;

private Builder(ExportWorkspaceAsyncOptions exportWorkspaceAsyncOptions) {
this.workspaceId = exportWorkspaceAsyncOptions.workspaceId;
this.includeAudit = exportWorkspaceAsyncOptions.includeAudit;
this.sort = exportWorkspaceAsyncOptions.sort;
this.verbose = exportWorkspaceAsyncOptions.verbose;
}

/** Instantiates a new builder. */
public Builder() {}

/**
* Instantiates a new builder with required properties.
*
* @param workspaceId the workspaceId
*/
public Builder(String workspaceId) {
this.workspaceId = workspaceId;
}

/**
* Builds a ExportWorkspaceAsyncOptions.
*
* @return the new ExportWorkspaceAsyncOptions instance
*/
public ExportWorkspaceAsyncOptions build() {
return new ExportWorkspaceAsyncOptions(this);
}

/**
* Set the workspaceId.
*
* @param workspaceId the workspaceId
* @return the ExportWorkspaceAsyncOptions builder
*/
public Builder workspaceId(String workspaceId) {
this.workspaceId = workspaceId;
return this;
}

/**
* Set the includeAudit.
*
* @param includeAudit the includeAudit
* @return the ExportWorkspaceAsyncOptions builder
*/
public Builder includeAudit(Boolean includeAudit) {
this.includeAudit = includeAudit;
return this;
}

/**
* Set the sort.
*
* @param sort the sort
* @return the ExportWorkspaceAsyncOptions builder
*/
public Builder sort(String sort) {
this.sort = sort;
return this;
}

/**
* Set the verbose.
*
* @param verbose the verbose
* @return the ExportWorkspaceAsyncOptions builder
*/
public Builder verbose(Boolean verbose) {
this.verbose = verbose;
return this;
}
}

protected ExportWorkspaceAsyncOptions() {}

protected ExportWorkspaceAsyncOptions(Builder builder) {
com.ibm.cloud.sdk.core.util.Validator.notEmpty(
builder.workspaceId, "workspaceId cannot be empty");
workspaceId = builder.workspaceId;
includeAudit = builder.includeAudit;
sort = builder.sort;
verbose = builder.verbose;
}

/**
* New builder.
*
* @return a ExportWorkspaceAsyncOptions builder
*/
public Builder newBuilder() {
return new Builder(this);
}

/**
* Gets the workspaceId.
*
* <p>Unique identifier of the workspace.
*
* @return the workspaceId
*/
public String workspaceId() {
return workspaceId;
}

/**
* Gets the includeAudit.
*
* <p>Whether to include the audit properties (`created` and `updated` timestamps) in the
* response.
*
* @return the includeAudit
*/
public Boolean includeAudit() {
return includeAudit;
}

/**
* Gets the sort.
*
* <p>Indicates how the returned workspace data will be sorted. Specify `sort=stable` to sort all
* workspace objects by unique identifier, in ascending alphabetical order.
*
* @return the sort
*/
public String sort() {
return sort;
}

/**
* Gets the verbose.
*
* <p>Whether the response should include the `counts` property, which indicates how many of each
* component (such as intents and entities) the workspace contains.
*
* @return the verbose
*/
public Boolean verbose() {
return verbose;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2017, 2020.
* (C) Copyright IBM Corp. 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 @@ -37,11 +37,9 @@ public Builder() {}
* Instantiates a new builder with required properties.
*
* @param intent the intent
* @param confidence the confidence
*/
public Builder(String intent, Double confidence) {
public Builder(String intent) {
this.intent = intent;
this.confidence = confidence;
}

/**
Expand Down Expand Up @@ -76,9 +74,10 @@ public Builder confidence(Double confidence) {
}
}

protected RuntimeIntent() {}

protected RuntimeIntent(Builder builder) {
com.ibm.cloud.sdk.core.util.Validator.notNull(builder.intent, "intent cannot be null");
com.ibm.cloud.sdk.core.util.Validator.notNull(builder.confidence, "confidence cannot be null");
intent = builder.intent;
confidence = builder.confidence;
}
Expand Down Expand Up @@ -106,7 +105,9 @@ public String intent() {
/**
* Gets the confidence.
*
* <p>A decimal percentage that represents Watson's confidence in the intent.
* <p>A decimal percentage that represents Watson's confidence in the intent. If you are
* specifying an intent as part of a request, but you do not have a calculated confidence value,
* specify `1`.
*
* @return the confidence
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*
* (C) Copyright IBM Corp. 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
*
* 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.assistant.v1.model;

import com.ibm.cloud.sdk.core.service.model.GenericModel;

/** An object describing an error that occurred during processing of an asynchronous operation. */
public class StatusError extends GenericModel {

protected String message;

/** Builder. */
public static class Builder {
private String message;

private Builder(StatusError statusError) {
this.message = statusError.message;
}

/** Instantiates a new builder. */
public Builder() {}

/**
* Builds a StatusError.
*
* @return the new StatusError instance
*/
public StatusError build() {
return new StatusError(this);
}

/**
* Set the message.
*
* @param message the message
* @return the StatusError builder
*/
public Builder message(String message) {
this.message = message;
return this;
}
}

protected StatusError() {}

protected StatusError(Builder builder) {
message = builder.message;
}

/**
* New builder.
*
* @return a StatusError builder
*/
public Builder newBuilder() {
return new Builder(this);
}

/**
* Gets the message.
*
* <p>The text of the error message.
*
* @return the message
*/
public String message() {
return message;
}
}
Loading

0 comments on commit 64a2622

Please sign in to comment.