Skip to content

Commit ca838f9

Browse files
committed
feat(assistant-v2): update models and add new methods
NEW methods: listEnvironments, getEnvironments, listReleases, getRelease, deployRelease
1 parent 2b8a2fc commit ca838f9

38 files changed

+2412
-26
lines changed

src/IBM.Watson.Assistant.v2/AssistantService.cs

+484-4
Large diffs are not rendered by default.

src/IBM.Watson.Assistant.v2/IAssistantService.cs

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2019, 2021.
2+
* (C) Copyright IBM Corp. 2022.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
1818
using IBM.Cloud.SDK.Core.Http;
1919
using System.Collections.Generic;
2020
using IBM.Watson.Assistant.v2.Model;
21+
using Environment = IBM.Watson.Assistant.v2.Model.Environment;
2122

2223
namespace IBM.Watson.Assistant.v2
2324
{
@@ -27,8 +28,13 @@ public partial interface IAssistantService
2728
DetailedResponse<object> DeleteSession(string assistantId, string sessionId);
2829
DetailedResponse<MessageResponse> Message(string assistantId, string sessionId, MessageInput input = null, MessageContext context = null, string userId = null);
2930
DetailedResponse<MessageResponseStateless> MessageStateless(string assistantId, MessageInputStateless input = null, MessageContextStateless context = null, string userId = null);
30-
DetailedResponse<BulkClassifyResponse> BulkClassify(string skillId, List<BulkClassifyUtterance> input = null);
31+
DetailedResponse<BulkClassifyResponse> BulkClassify(string skillId, List<BulkClassifyUtterance> input);
3132
DetailedResponse<LogCollection> ListLogs(string assistantId, string sort = null, string filter = null, long? pageLimit = null, string cursor = null);
3233
DetailedResponse<object> DeleteUserData(string customerId);
34+
DetailedResponse<EnvironmentCollection> ListEnvironments(string assistantId, long? pageLimit = null, bool? includeCount = null, string sort = null, string cursor = null, bool? includeAudit = null);
35+
DetailedResponse<Environment> GetEnvironment(string assistantId, string environmentId, bool? includeAudit = null);
36+
DetailedResponse<ReleaseCollection> ListReleases(string assistantId, long? pageLimit = null, bool? includeCount = null, string sort = null, string cursor = null, bool? includeAudit = null);
37+
DetailedResponse<Release> GetRelease(string assistantId, string release, bool? includeAudit = null);
38+
DetailedResponse<Environment> DeployRelease(string assistantId, string release, string environmentId, bool? includeAudit = null);
3339
}
3440
}

src/IBM.Watson.Assistant.v2/Model/DialogNodeVisited.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
namespace IBM.Watson.Assistant.v2.Model
2121
{
2222
/// <summary>
23-
/// An objects containing detailed diagnostic information about a dialog node that was triggered during processing
24-
/// of the input message.
23+
/// An objects containing detailed diagnostic information about a dialog node that was visited during processing of
24+
/// the input message.
2525
/// </summary>
2626
public class DialogNodeVisited
2727
{
2828
/// <summary>
29-
/// A dialog node that was triggered during processing of the input message.
29+
/// A dialog node that was visited during processing of the input message.
3030
/// </summary>
3131
[JsonProperty("dialog_node", NullValueHandling = NullValueHandling.Ignore)]
3232
public string DialogNode { get; set; }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/**
2+
* (C) Copyright IBM Corp. 2022.
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+
*/
17+
18+
using System.Collections.Generic;
19+
using Newtonsoft.Json;
20+
using System;
21+
22+
namespace IBM.Watson.Assistant.v2.Model
23+
{
24+
/// <summary>
25+
/// Environment.
26+
/// </summary>
27+
public class Environment
28+
{
29+
/// <summary>
30+
/// The name of the environment.
31+
/// </summary>
32+
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
33+
public string Name { get; set; }
34+
/// <summary>
35+
/// The description of the environment.
36+
/// </summary>
37+
[JsonProperty("description", NullValueHandling = NullValueHandling.Ignore)]
38+
public string Description { get; set; }
39+
/// <summary>
40+
/// The language of the environment. An environment is always created with the same language as the assistant it
41+
/// is associated with.
42+
/// </summary>
43+
[JsonProperty("language", NullValueHandling = NullValueHandling.Ignore)]
44+
public string Language { get; set; }
45+
/// <summary>
46+
/// The assistant ID of the assistant the environment is associated with.
47+
/// </summary>
48+
[JsonProperty("assistant_id", NullValueHandling = NullValueHandling.Ignore)]
49+
public virtual string AssistantId { get; private set; }
50+
/// <summary>
51+
/// The environment ID of the environment.
52+
/// </summary>
53+
[JsonProperty("environment_id", NullValueHandling = NullValueHandling.Ignore)]
54+
public virtual string EnvironmentId { get; private set; }
55+
/// <summary>
56+
/// The type of the environment. All environments other than the `draft` and `live` environments have the type
57+
/// `staging`.
58+
/// </summary>
59+
[JsonProperty("environment", NullValueHandling = NullValueHandling.Ignore)]
60+
public virtual string _Environment { get; private set; }
61+
/// <summary>
62+
/// An object describing the release that is currently deployed in the environment.
63+
/// </summary>
64+
[JsonProperty("release_reference", NullValueHandling = NullValueHandling.Ignore)]
65+
public EnvironmentReleaseReference ReleaseReference { get; set; }
66+
/// <summary>
67+
/// The search skill orchestration settings for the environment.
68+
/// </summary>
69+
[JsonProperty("orchestration", NullValueHandling = NullValueHandling.Ignore)]
70+
public EnvironmentOrchestration Orchestration { get; set; }
71+
/// <summary>
72+
/// The session inactivity timeout setting for the environment.
73+
/// </summary>
74+
[JsonProperty("session_timeout", NullValueHandling = NullValueHandling.Ignore)]
75+
public long? SessionTimeout { get; set; }
76+
/// <summary>
77+
/// An array of objects describing the integrations that exist in the environment.
78+
/// </summary>
79+
[JsonProperty("integration_references", NullValueHandling = NullValueHandling.Ignore)]
80+
public List<IntegrationReference> IntegrationReferences { get; set; }
81+
/// <summary>
82+
/// An array of objects describing the skills (such as actions and dialog) that exist in the environment.
83+
/// </summary>
84+
[JsonProperty("skill_references", NullValueHandling = NullValueHandling.Ignore)]
85+
public List<SkillReference> SkillReferences { get; set; }
86+
/// <summary>
87+
/// The timestamp for creation of the object.
88+
/// </summary>
89+
[JsonProperty("created", NullValueHandling = NullValueHandling.Ignore)]
90+
public virtual DateTime? Created { get; private set; }
91+
/// <summary>
92+
/// The timestamp for the most recent update to the object.
93+
/// </summary>
94+
[JsonProperty("updated", NullValueHandling = NullValueHandling.Ignore)]
95+
public virtual DateTime? Updated { get; private set; }
96+
}
97+
98+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* (C) Copyright IBM Corp. 2022.
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+
*/
17+
18+
using System.Collections.Generic;
19+
using Newtonsoft.Json;
20+
21+
namespace IBM.Watson.Assistant.v2.Model
22+
{
23+
/// <summary>
24+
/// EnvironmentCollection.
25+
/// </summary>
26+
public class EnvironmentCollection
27+
{
28+
/// <summary>
29+
/// An array of objects describing the environments associated with an assistant.
30+
/// </summary>
31+
[JsonProperty("environments", NullValueHandling = NullValueHandling.Ignore)]
32+
public List<Environment> Environments { get; set; }
33+
/// <summary>
34+
/// The pagination data for the returned objects.
35+
/// </summary>
36+
[JsonProperty("pagination", NullValueHandling = NullValueHandling.Ignore)]
37+
public Pagination Pagination { get; set; }
38+
}
39+
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* (C) Copyright IBM Corp. 2022.
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+
*/
17+
18+
using Newtonsoft.Json;
19+
20+
namespace IBM.Watson.Assistant.v2.Model
21+
{
22+
/// <summary>
23+
/// The search skill orchestration settings for the environment.
24+
/// </summary>
25+
public class EnvironmentOrchestration
26+
{
27+
/// <summary>
28+
/// Whether assistants deployed to the environment fall back to a search skill when responding to messages that
29+
/// do not match any intent. If no search skill is configured for the assistant, this property is ignored.
30+
/// </summary>
31+
[JsonProperty("search_skill_fallback", NullValueHandling = NullValueHandling.Ignore)]
32+
public bool? SearchSkillFallback { get; set; }
33+
}
34+
35+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/**
2+
* (C) Copyright IBM Corp. 2022.
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+
*/
17+
18+
using Newtonsoft.Json;
19+
20+
namespace IBM.Watson.Assistant.v2.Model
21+
{
22+
/// <summary>
23+
/// EnvironmentReference.
24+
/// </summary>
25+
public class EnvironmentReference
26+
{
27+
/// <summary>
28+
/// The type of the deployed environment. All environments other than the draft and live environments have the
29+
/// type `staging`.
30+
/// </summary>
31+
public class EnvironmentEnumValue
32+
{
33+
/// <summary>
34+
/// Constant DRAFT for draft
35+
/// </summary>
36+
public const string DRAFT = "draft";
37+
/// <summary>
38+
/// Constant LIVE for live
39+
/// </summary>
40+
public const string LIVE = "live";
41+
/// <summary>
42+
/// Constant STAGING for staging
43+
/// </summary>
44+
public const string STAGING = "staging";
45+
46+
}
47+
48+
/// <summary>
49+
/// The type of the deployed environment. All environments other than the draft and live environments have the
50+
/// type `staging`.
51+
/// Constants for possible values can be found using EnvironmentReference.EnvironmentEnumValue
52+
/// </summary>
53+
[JsonProperty("environment", NullValueHandling = NullValueHandling.Ignore)]
54+
public string Environment { get; set; }
55+
/// <summary>
56+
/// The name of the deployed environment.
57+
/// </summary>
58+
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
59+
public string Name { get; set; }
60+
/// <summary>
61+
/// The environment ID of the deployed environment.
62+
/// </summary>
63+
[JsonProperty("environment_id", NullValueHandling = NullValueHandling.Ignore)]
64+
public virtual string EnvironmentId { get; private set; }
65+
}
66+
67+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* (C) Copyright IBM Corp. 2022.
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+
*/
17+
18+
using Newtonsoft.Json;
19+
20+
namespace IBM.Watson.Assistant.v2.Model
21+
{
22+
/// <summary>
23+
/// An object describing the release that is currently deployed in the environment.
24+
/// </summary>
25+
public class EnvironmentReleaseReference
26+
{
27+
/// <summary>
28+
/// The name of the deployed release.
29+
/// </summary>
30+
[JsonProperty("release", NullValueHandling = NullValueHandling.Ignore)]
31+
public string Release { get; set; }
32+
}
33+
34+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* (C) Copyright IBM Corp. 2022.
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+
*/
17+
18+
using Newtonsoft.Json;
19+
20+
namespace IBM.Watson.Assistant.v2.Model
21+
{
22+
/// <summary>
23+
/// IntegrationReference.
24+
/// </summary>
25+
public class IntegrationReference
26+
{
27+
/// <summary>
28+
/// The integration ID of the integration.
29+
/// </summary>
30+
[JsonProperty("integration_id", NullValueHandling = NullValueHandling.Ignore)]
31+
public string IntegrationId { get; set; }
32+
/// <summary>
33+
/// The type of the integration.
34+
/// </summary>
35+
[JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)]
36+
public string Type { get; set; }
37+
}
38+
39+
}

src/IBM.Watson.Assistant.v2/Model/MessageContext.cs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2018, 2022.
2+
* (C) Copyright IBM Corp. 2022.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,9 +32,6 @@ public class MessageContext
3232
public MessageContextGlobal Global { get; set; }
3333
/// <summary>
3434
/// Information specific to particular skills used by the assistant.
35-
///
36-
/// **Note:** Currently, only a single child property is supported, containing variables that apply to the
37-
/// dialog skill used by the assistant.
3835
/// </summary>
3936
[JsonProperty("skills", NullValueHandling = NullValueHandling.Ignore)]
4037
public Dictionary<string, MessageContextSkill> Skills { get; set; }

0 commit comments

Comments
 (0)