Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CUT-3929: Fix BulkUser models #72

Merged
merged 47 commits into from
May 15, 2024
Merged

CUT-3929: Fix BulkUser models #72

merged 47 commits into from
May 15, 2024

Conversation

gweinjc
Copy link
Contributor

@gweinjc gweinjc commented Mar 29, 2024

Issues

What does this solve?

The BulkUser models only allowed editing select properties instead of all systemUser properties that is indicated by the endpoint.

Before:
image

After:
image
image

Is there anything particularly tricky?

A few of the properties were references to other existing models that had to be transformed/flattened such as the 'mfa' property.

How should this be tested?

  1. Import the latest version of JumpCloud.SDK.V2
  2. Run the below script to test updating 2 users. Be sure to change the respective Ids to user's in your organization
$users = @(
    @{
        id = '612010ef83e5ac3835fe0c57'
        jobTitle = 'BulkUpdateTest'
        department = 'BulkUpdateTest'
        Manager = '636a9aaf4db1beb9f7cb28dd'
        description = 'BulkUpdateTest'
     },
    @{
         id = '636a9aaf4db1beb9f7cb28dd'
         jobTitle = 'BulkUpdateTest'
         department = 'BulkUpdateTest'
         Manager = '612010ef83e5ac3835fe0c57'
         description = 'BulkUpdateTest'
     }
 )
 Update-JcSdkBulkUser -Body $users
  1. Run the below script to test creating 2 users
 $users = @(
    @{
        email = 'bulkUser1@jcbulkusertest.com'
        firstName = 'BulkUser1'
        lastName = 'BulkUser1'
        username = 'BulkUser1'
        jobTitle = 'BulkCreateTest'
        department = 'BulkCreateTest'
        description = 'BulkCreateTest'
     },
     @{
        email = 'bulkUser2@jcbulkusertest.com'
        firstName = 'BulkUser2'
        lastName = 'BulkUser2'
        username = 'BulkUser2'
        jobTitle = 'BulkCreateTest'
        department = 'BulkCreateTest'
        description = 'BulkCreateTest'
     }
 )
 New-JCSdkBulkUser -Body $users -CreationSource 'jumpcloud:bulk'
  1. Go into the Console and validate that the 2 created user's have their respective properties set and the updated users have theirs set as well.

@gweinjc gweinjc marked this pull request as ready for review March 29, 2024 21:10
@gweinjc gweinjc requested a review from a team as a code owner March 29, 2024 21:10
@gweinjc gweinjc added patch Patch SDK Release Version SDK SDK Release Label labels Apr 1, 2024
jworkmanjc
jworkmanjc previously approved these changes May 9, 2024
Copy link
Contributor

@jworkmanjc jworkmanjc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested both update and create bulk user, works on my end :) the manager field works!
Screenshot 2024-05-09 at 11 37 00 AM
Screenshot 2024-05-09 at 11 36 39 AM

kmaranionjc
kmaranionjc previously approved these changes May 9, 2024
Copy link
Contributor

@kmaranionjc kmaranionjc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update and create tests worked on my end. Code looks good. Great job!
image

@gweinjc gweinjc requested review from jworkmanjc and kmaranionjc May 15, 2024 19:38
Copy link
Contributor

@jworkmanjc jworkmanjc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested Working :)

@gweinjc gweinjc merged commit d306e9c into master May 15, 2024
12 checks passed
@gweinjc gweinjc deleted the CUT-3929_BulkUserInputObject branch May 15, 2024 20:40
@gweinjc gweinjc temporarily deployed to PublishToPSGallery May 15, 2024 20:41 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Patch SDK Release Version SDK SDK Release Label
Development

Successfully merging this pull request may close these issues.

3 participants