Beispiel #1
0
        public async Task AddUserToWorkspace_ShouldReturnWorkspaceSettings()
        {
            string _workspaceId = await SetupHelper.CreateOrFindWorkspaceAsync(_client, "Clockify.NetTestWorkspace");

            var request = new WorkspaceAddUserRequest
            {
                Email = Guid.NewGuid() + "@example.com",
            };

            var response = await _client.AddWorkspaceUser(_workspaceId, request);

            response.StatusCode.Equals(HttpStatusCode.Created);
        }
        /// <summary>
        /// Adds a user to workspace.
        /// </summary>
        public Task <IRestResponse <List <WorkspaceDto> > > AddWorkspaceUser(string workspaceId, WorkspaceAddUserRequest requestBody)
        {
            var request = new RestRequest($"/workspaces/{workspaceId}/users");

            request.AddJsonBody(requestBody);

            return(_client.ExecuteAsync <List <WorkspaceDto> >(request, Method.POST));
        }