Skip to content

Commit c44118e

Browse files
committed
feat: Regenerate all services other than Assistant v1
1 parent 9f21323 commit c44118e

File tree

480 files changed

+8403
-4514
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

480 files changed

+8403
-4514
lines changed

assistant/src/main/java/com/ibm/watson/assistant/v2/Assistant.java

Lines changed: 18 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018 IBM Corp. All Rights Reserved.
2+
* (C) Copyright IBM Corp. 2019.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -16,11 +16,9 @@
1616
import com.ibm.cloud.sdk.core.http.RequestBuilder;
1717
import com.ibm.cloud.sdk.core.http.ResponseConverter;
1818
import com.ibm.cloud.sdk.core.http.ServiceCall;
19-
import com.ibm.cloud.sdk.core.security.AuthenticatorConfig;
19+
import com.ibm.cloud.sdk.core.security.Authenticator;
2020
import com.ibm.cloud.sdk.core.service.BaseService;
21-
import com.ibm.cloud.sdk.core.util.GsonSingleton;
2221
import com.ibm.cloud.sdk.core.util.ResponseConverterUtils;
23-
import com.ibm.cloud.sdk.core.util.Validator;
2422
import com.ibm.watson.assistant.v2.model.CreateSessionOptions;
2523
import com.ibm.watson.assistant.v2.model.DeleteSessionOptions;
2624
import com.ibm.watson.assistant.v2.model.MessageOptions;
@@ -35,7 +33,7 @@
3533
* dialog editor to create conversation flows between your apps and your users.
3634
*
3735
* @version v2
38-
* @see <a href="http://www.ibm.com/watson/developercloud/assistant.html">Assistant</a>
36+
* @see <a href="https://cloud.ibm.com/docs/services/assistant/">Assistant</a>
3937
*/
4038
public class Assistant extends BaseService {
4139

@@ -45,54 +43,19 @@ public class Assistant extends BaseService {
4543
private String versionDate;
4644

4745
/**
48-
* Instantiates a new `Assistant`.
46+
* Constructs a new `Assistant` client with the specified Authenticator.
4947
*
5048
* @param versionDate The version date (yyyy-MM-dd) of the REST API to use. Specifying this value will keep your API
5149
* calls from failing when the service introduces breaking changes.
52-
* @deprecated Use Assistant(String versionDate, AuthenticatorConfig authenticatorConfig) instead
50+
* @param authenticator the Authenticator instance to be configured for this service
5351
*/
54-
@Deprecated
55-
public Assistant(String versionDate) {
56-
super(SERVICE_NAME);
52+
public Assistant(String versionDate, Authenticator authenticator) {
53+
super(SERVICE_NAME, authenticator);
5754
if ((getEndPoint() == null) || getEndPoint().isEmpty()) {
5855
setEndPoint(URL);
5956
}
60-
61-
Validator.isTrue((versionDate != null) && !versionDate.isEmpty(), "version cannot be null.");
62-
63-
this.versionDate = versionDate;
64-
}
65-
66-
/**
67-
* Instantiates a new `Assistant` with username and password.
68-
*
69-
* @param versionDate The version date (yyyy-MM-dd) of the REST API to use. Specifying this value will keep your API
70-
* calls from failing when the service introduces breaking changes.
71-
* @param username the username
72-
* @param password the password
73-
* @deprecated Use Assistant(String versionDate, AuthenticatorConfig authenticatorConfig) instead
74-
*/
75-
@Deprecated
76-
public Assistant(String versionDate, String username, String password) {
77-
this(versionDate);
78-
setUsernameAndPassword(username, password);
79-
}
80-
81-
/**
82-
* Instantiates a new `Assistant` with the specified authentication configuration.
83-
*
84-
* @param versionDate The version date (yyyy-MM-dd) of the REST API to use. Specifying this value will keep your API
85-
* calls from failing when the service introduces breaking changes.
86-
* @param authenticatorConfig the authentication configuration for this service
87-
*/
88-
public Assistant(String versionDate, AuthenticatorConfig authenticatorConfig) {
89-
super(SERVICE_NAME);
90-
if ((getEndPoint() == null) || getEndPoint().isEmpty()) {
91-
setEndPoint(URL);
92-
}
93-
setAuthenticator(authenticatorConfig);
94-
95-
Validator.isTrue((versionDate != null) && !versionDate.isEmpty(), "version cannot be null.");
57+
com.ibm.cloud.sdk.core.util.Validator.isTrue((versionDate != null) && !versionDate.isEmpty(),
58+
"version cannot be null.");
9659
this.versionDate = versionDate;
9760
}
9861

@@ -106,7 +69,8 @@ public Assistant(String versionDate, AuthenticatorConfig authenticatorConfig) {
10669
* @return a {@link ServiceCall} with a response type of {@link SessionResponse}
10770
*/
10871
public ServiceCall<SessionResponse> createSession(CreateSessionOptions createSessionOptions) {
109-
Validator.notNull(createSessionOptions, "createSessionOptions cannot be null");
72+
com.ibm.cloud.sdk.core.util.Validator.notNull(createSessionOptions,
73+
"createSessionOptions cannot be null");
11074
String[] pathSegments = { "v2/assistants", "sessions" };
11175
String[] pathParameters = { createSessionOptions.assistantId() };
11276
RequestBuilder builder = RequestBuilder.post(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
@@ -132,7 +96,8 @@ public ServiceCall<SessionResponse> createSession(CreateSessionOptions createSes
13296
* @return a {@link ServiceCall} with a response type of Void
13397
*/
13498
public ServiceCall<Void> deleteSession(DeleteSessionOptions deleteSessionOptions) {
135-
Validator.notNull(deleteSessionOptions, "deleteSessionOptions cannot be null");
99+
com.ibm.cloud.sdk.core.util.Validator.notNull(deleteSessionOptions,
100+
"deleteSessionOptions cannot be null");
136101
String[] pathSegments = { "v2/assistants", "sessions" };
137102
String[] pathParameters = { deleteSessionOptions.assistantId(), deleteSessionOptions.sessionId() };
138103
RequestBuilder builder = RequestBuilder.delete(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
@@ -158,7 +123,8 @@ public ServiceCall<Void> deleteSession(DeleteSessionOptions deleteSessionOptions
158123
* @return a {@link ServiceCall} with a response type of {@link MessageResponse}
159124
*/
160125
public ServiceCall<MessageResponse> message(MessageOptions messageOptions) {
161-
Validator.notNull(messageOptions, "messageOptions cannot be null");
126+
com.ibm.cloud.sdk.core.util.Validator.notNull(messageOptions,
127+
"messageOptions cannot be null");
162128
String[] pathSegments = { "v2/assistants", "sessions", "message" };
163129
String[] pathParameters = { messageOptions.assistantId(), messageOptions.sessionId() };
164130
RequestBuilder builder = RequestBuilder.post(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
@@ -171,10 +137,11 @@ public ServiceCall<MessageResponse> message(MessageOptions messageOptions) {
171137
builder.header("Accept", "application/json");
172138
final JsonObject contentJson = new JsonObject();
173139
if (messageOptions.input() != null) {
174-
contentJson.add("input", GsonSingleton.getGson().toJsonTree(messageOptions.input()));
140+
contentJson.add("input", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(messageOptions.input()));
175141
}
176142
if (messageOptions.context() != null) {
177-
contentJson.add("context", GsonSingleton.getGson().toJsonTree(messageOptions.context()));
143+
contentJson.add("context", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(messageOptions
144+
.context()));
178145
}
179146
builder.bodyJson(contentJson);
180147
ResponseConverter<MessageResponse> responseConverter = ResponseConverterUtils.getValue(
Lines changed: 96 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018 IBM Corp. All Rights Reserved.
2+
* (C) Copyright IBM Corp. 2019.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -12,6 +12,7 @@
1212
*/
1313
package com.ibm.watson.assistant.v2.model;
1414

15+
import java.util.ArrayList;
1516
import java.util.List;
1617

1718
import com.ibm.cloud.sdk.core.service.model.GenericModel;
@@ -24,14 +25,106 @@ public class CaptureGroup extends GenericModel {
2425
private String group;
2526
private List<Long> location;
2627

28+
/**
29+
* Builder.
30+
*/
31+
public static class Builder {
32+
private String group;
33+
private List<Long> location;
34+
35+
private Builder(CaptureGroup captureGroup) {
36+
this.group = captureGroup.group;
37+
this.location = captureGroup.location;
38+
}
39+
40+
/**
41+
* Instantiates a new builder.
42+
*/
43+
public Builder() {
44+
}
45+
46+
/**
47+
* Instantiates a new builder with required properties.
48+
*
49+
* @param group the group
50+
*/
51+
public Builder(String group) {
52+
this.group = group;
53+
}
54+
55+
/**
56+
* Builds a CaptureGroup.
57+
*
58+
* @return the captureGroup
59+
*/
60+
public CaptureGroup build() {
61+
return new CaptureGroup(this);
62+
}
63+
64+
/**
65+
* Adds an location to location.
66+
*
67+
* @param location the new location
68+
* @return the CaptureGroup builder
69+
*/
70+
public Builder addLocation(Long location) {
71+
com.ibm.cloud.sdk.core.util.Validator.notNull(location,
72+
"location cannot be null");
73+
if (this.location == null) {
74+
this.location = new ArrayList<Long>();
75+
}
76+
this.location.add(location);
77+
return this;
78+
}
79+
80+
/**
81+
* Set the group.
82+
*
83+
* @param group the group
84+
* @return the CaptureGroup builder
85+
*/
86+
public Builder group(String group) {
87+
this.group = group;
88+
return this;
89+
}
90+
91+
/**
92+
* Set the location.
93+
* Existing location will be replaced.
94+
*
95+
* @param location the location
96+
* @return the CaptureGroup builder
97+
*/
98+
public Builder location(List<Long> location) {
99+
this.location = location;
100+
return this;
101+
}
102+
}
103+
104+
private CaptureGroup(Builder builder) {
105+
com.ibm.cloud.sdk.core.util.Validator.notNull(builder.group,
106+
"group cannot be null");
107+
group = builder.group;
108+
location = builder.location;
109+
}
110+
111+
/**
112+
* New builder.
113+
*
114+
* @return a CaptureGroup builder
115+
*/
116+
public Builder newBuilder() {
117+
return new Builder(this);
118+
}
119+
27120
/**
28121
* Gets the group.
29122
*
30123
* A recognized capture group for the entity.
31124
*
32125
* @return the group
33126
*/
34-
public String getGroup() {
127+
public String group() {
35128
return group;
36129
}
37130

@@ -42,25 +135,7 @@ public String getGroup() {
42135
*
43136
* @return the location
44137
*/
45-
public List<Long> getLocation() {
138+
public List<Long> location() {
46139
return location;
47140
}
48-
49-
/**
50-
* Sets the group.
51-
*
52-
* @param group the new group
53-
*/
54-
public void setGroup(final String group) {
55-
this.group = group;
56-
}
57-
58-
/**
59-
* Sets the location.
60-
*
61-
* @param location the new location
62-
*/
63-
public void setLocation(final List<Long> location) {
64-
this.location = location;
65-
}
66141
}

assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateSessionOptions.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018 IBM Corp. All Rights Reserved.
2+
* (C) Copyright IBM Corp. 2019.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -13,7 +13,6 @@
1313
package com.ibm.watson.assistant.v2.model;
1414

1515
import com.ibm.cloud.sdk.core.service.model.GenericModel;
16-
import com.ibm.cloud.sdk.core.util.Validator;
1716

1817
/**
1918
* The createSession options.
@@ -69,7 +68,8 @@ public Builder assistantId(String assistantId) {
6968
}
7069

7170
private CreateSessionOptions(Builder builder) {
72-
Validator.notEmpty(builder.assistantId, "assistantId cannot be empty");
71+
com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.assistantId,
72+
"assistantId cannot be empty");
7373
assistantId = builder.assistantId;
7474
}
7575

assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteSessionOptions.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018 IBM Corp. All Rights Reserved.
2+
* (C) Copyright IBM Corp. 2019.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -13,7 +13,6 @@
1313
package com.ibm.watson.assistant.v2.model;
1414

1515
import com.ibm.cloud.sdk.core.service.model.GenericModel;
16-
import com.ibm.cloud.sdk.core.util.Validator;
1716

1817
/**
1918
* The deleteSession options.
@@ -85,8 +84,10 @@ public Builder sessionId(String sessionId) {
8584
}
8685

8786
private DeleteSessionOptions(Builder builder) {
88-
Validator.notEmpty(builder.assistantId, "assistantId cannot be empty");
89-
Validator.notEmpty(builder.sessionId, "sessionId cannot be empty");
87+
com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.assistantId,
88+
"assistantId cannot be empty");
89+
com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.sessionId,
90+
"sessionId cannot be empty");
9091
assistantId = builder.assistantId;
9192
sessionId = builder.sessionId;
9293
}

assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogLogMessage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018 IBM Corp. All Rights Reserved.
2+
* (C) Copyright IBM Corp. 2019.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at

0 commit comments

Comments
 (0)