use of com.google.cloud.dialogflow.cx.v3beta1.Version in project java-dialogflow-cx by googleapis.
the class ITSystemTest method tearDown.
@AfterClass
public static void tearDown() {
/* delete version */
DeleteVersionRequest deleteVersionRequest = DeleteVersionRequest.newBuilder().setName(versionName).build();
versionsClient.deleteVersion(deleteVersionRequest);
versionsClient.close();
/* delete transition route groups */
DeleteTransitionRouteGroupRequest deleteTransitionRouteGroupRequest = DeleteTransitionRouteGroupRequest.newBuilder().setName(transitionRouteGroupName).build();
transitionRouteGroupsClient.deleteTransitionRouteGroup(deleteTransitionRouteGroupRequest);
transitionRouteGroupsClient.close();
/* delete session */
sessionsClient.close();
/* delete pages */
DeletePageRequest deletePageRequest = DeletePageRequest.newBuilder().setName(pageName).build();
pagesClient.deletePage(deletePageRequest);
pagesClient.close();
/* delete intents */
DeleteIntentRequest deleteIntentRequest = DeleteIntentRequest.newBuilder().setName(intentsName).build();
intentsClient.deleteIntent(deleteIntentRequest);
intentsClient.close();
/* delete flows */
DeleteFlowRequest deleteFlowRequest = DeleteFlowRequest.newBuilder().setName(flowName).build();
flowsClient.deleteFlow(deleteFlowRequest);
DeleteFlowRequest deleteTrainFlowRequest = DeleteFlowRequest.newBuilder().setName(trainFlowName).build();
flowsClient.deleteFlow(deleteTrainFlowRequest);
flowsClient.close();
/* delete entity types */
DeleteEntityTypeRequest deleteEntityTypeRequest = DeleteEntityTypeRequest.newBuilder().setName(entityTypesName).build();
entityTypesClient.deleteEntityType(deleteEntityTypeRequest);
entityTypesClient.close();
/* delete agents */
DeleteAgentRequest deleteAgentRequest = DeleteAgentRequest.newBuilder().setName(agentName).build();
agentsClient.deleteAgent(deleteAgentRequest);
agentsClient.close();
}
use of com.google.cloud.dialogflow.cx.v3beta1.Version in project java-dialogflow-cx by googleapis.
the class ITSystemTest method updateVersionTest.
@Test
public void updateVersionTest() {
Version version = Version.newBuilder().setName(versionName).setDisplayName(DISPLAY_NAME).setState(Version.State.SUCCEEDED).build();
FieldMask updateMask = FieldMask.newBuilder().build();
UpdateVersionRequest versionRequest = UpdateVersionRequest.newBuilder().setVersion(version).setUpdateMask(updateMask).build();
Version updatedVersion = versionsClient.updateVersion(versionRequest);
assertEquals(Version.State.SUCCEEDED, updatedVersion.getState());
}
use of com.google.cloud.dialogflow.cx.v3beta1.Version in project java-dialogflow-cx by googleapis.
the class ITSystemTest method listVersionsTest.
@Test
public void listVersionsTest() {
ListVersionsRequest versionsRequest = ListVersionsRequest.newBuilder().setParent(flowName).build();
VersionsClient.ListVersionsPagedResponse pagedListResponse = versionsClient.listVersions(versionsRequest);
List<Version> versions = Lists.newArrayList(pagedListResponse.iterateAll());
boolean isVersionNameExists = false;
for (Version version : versions) {
if (version.getName().equals(versionName)) {
assertVersionDetails(version);
isVersionNameExists = true;
}
}
assertTrue(isVersionNameExists);
}
use of com.google.cloud.dialogflow.cx.v3beta1.Version in project java-dialogflow-cx by googleapis.
the class ITSystemTest method getVersionTest.
@Test
public void getVersionTest() {
GetVersionRequest versionRequest = GetVersionRequest.newBuilder().setName(versionName).build();
Version version = versionsClient.getVersion(versionRequest);
assertVersionDetails(version);
}
use of com.google.cloud.dialogflow.cx.v3beta1.Version in project dcache by dCache.
the class DCapDoorInterpreterV3Tests method versionShouldMatchTo.
@Test
public void versionShouldMatchTo() {
Version v1_2 = new Version(1, 2);
Version v1_1 = new Version(1, 1);
Version v2_1 = new Version(2, 1);
Version v1_1_1 = new Version(1, 1, 1, null);
Version v1_1_2 = new Version(1, 1, 2, null);
Version v1_1_1_1 = new Version(1, 1, 1, "1");
Version v1_1_1_2 = new Version(1, 1, 1, "2");
assertThat(v1_1.matches(v1_1), is(equalTo(0)));
assertThat(v1_2.matches(v1_2), is(equalTo(0)));
assertThat(v2_1.matches(v2_1), is(equalTo(0)));
assertThat(v1_1_1.matches(v1_1_1), is(equalTo(0)));
assertThat(v1_1_2.matches(v1_1_2), is(equalTo(0)));
assertThat(v1_1_1_1.matches(v1_1_1_1), is(equalTo(0)));
assertThat(v1_1_1_2.matches(v1_1_1_2), is(equalTo(0)));
assertThat(v1_1.matches(v1_1_1), is(equalTo(0)));
assertThat(v1_1.matches(v1_1_1_1), is(equalTo(0)));
assertThat(v1_1_1.matches(v1_1_1_1), is(equalTo(0)));
assertThat(v1_1.matches(v1_2), is(equalTo(-1)));
assertThat(v1_2.matches(v1_1), is(equalTo(1)));
assertThat(v1_1.matches(v1_2), is(equalTo(-1)));
assertThat(v2_1.matches(v1_1), is(equalTo(1)));
assertThat(v1_2.matches(v2_1), is(equalTo(-1)));
assertThat(v2_1.matches(v1_2), is(equalTo(1)));
assertThat(v1_1_1.matches(v1_1), is(equalTo(1)));
assertThat(v1_1_1.matches(v1_1_2), is(equalTo(-1)));
assertThat(v1_1_2.matches(v1_1_1), is(equalTo(1)));
assertThat(v1_1_1_1.matches(v1_1_1), is(equalTo(1)));
assertThat(v1_1_1_1.matches(v1_1_1_2), is(equalTo(-1)));
assertThat(v1_1_1_2.matches(v1_1_1_1), is(equalTo(1)));
}
Aggregations