public EntityCollectionResponse ListEntities(string workspaceId, bool?export = null, long?pageLimit = null, bool?includeCount = null, string sort = null, string cursor = null) { if (string.IsNullOrEmpty(workspaceId)) { throw new ArgumentNullException(nameof(workspaceId)); } if (string.IsNullOrEmpty(VersionDate)) { throw new ArgumentNullException("versionDate cannot be null. Use 'CONVERSATION_VERSION_DATE_2017_05_26'"); } EntityCollectionResponse result = null; try { result = this.Client.WithAuthentication(this.UserName, this.Password) .GetAsync($"{this.Endpoint}/v1/workspaces/{workspaceId}/entities") .WithArgument("version", VersionDate) .WithArgument("export", export) .WithArgument("page_limit", pageLimit) .WithArgument("include_count", includeCount) .WithArgument("sort", sort) .WithArgument("cursor", cursor) .As <EntityCollectionResponse>() .Result; } catch (AggregateException ae) { throw ae.Flatten(); } return(result); }
private void AssertResponseIsValid(EntityCollectionResponse response) { Assert.That(response, Is.Not.Null); Assert.That(response.Result, Is.Not.Null); Assert.That(response.Result.Count, Is.Positive); }