public WorkspaceCollectionResponse ListWorkspaces(long?pageLimit = null, bool?includeCount = null, string sort = null, string cursor = null) { if (string.IsNullOrEmpty(VersionDate)) { throw new ArgumentNullException("versionDate cannot be null. Use 'CONVERSATION_VERSION_DATE_2017_05_26'"); } WorkspaceCollectionResponse result = null; try { result = this.Client.WithAuthentication(this.UserName, this.Password) .GetAsync($"{this.Endpoint}/v1/workspaces") .WithArgument("version", VersionDate) .WithArgument("page_limit", pageLimit) .WithArgument("include_count", includeCount) .WithArgument("sort", sort) .WithArgument("cursor", cursor) .As <WorkspaceCollectionResponse>() .Result; } catch (AggregateException ae) { throw ae.Flatten(); } return(result); }
public WorkspaceCollectionResponse ListWorkspaces() { WorkspaceCollectionResponse result = null; try { result = this.Client.WithAuthentication(this.UserName, this.Password) .GetAsync($"{this.Endpoint}{PATH_CONVERSATION}") .WithArgument("version", VERSION_DATE_2017_05_26) .WithHeader("accept", HttpMediaType.APPLICATION_JSON) .As <WorkspaceCollectionResponse>() .Result; } catch (AggregateException ae) { throw ae.Flatten(); } return(result); }