internal/New-JcSdkInternalBulkUser.ps1
|
# ---------------------------------------------------------------------------------- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.8, generator: @autorest/powershell@4.0.749) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # ---------------------------------------------------------------------------------- <# .Synopsis The endpoint allows you to create a bulk job to asynchronously create users.\nSee [create a System User](https://docs.jumpcloud.com/api/1.0/index.html#operation/systemusers_post)\nfor the full list of attributes.\n\n#### Default User State\nThe `state` of each user in the request can be explicitly passed in or\nomitted. If `state` is omitted, then the user will get created\nusing the value returned from the\n[Get an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organizations_get)\nendpoint. The default user state for bulk created users depends on the\n`creation-source` header. For `creation-source:jumpcloud:bulk` the\ndefault state is stored in `settings.newSystemUserStateDefaults.csvImport`.\nFor other `creation-source` header values, the default state is stored in\n`settings.newSystemUserStateDefaults.applicationImport`\n\nThese default state values can be changed in the admin portal settings\nor by using the\n[create an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organization_put)\nendpoint.\n\n#### Sample Request\n\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/bulk/users \\\n-H 'Accept: application/json' \\\n-H 'Content-Type: application/json' \\\n-H 'x-api-key: {API_KEY}' \\\n-d '[\n {\n \"email\":\"{email}\",\n \"firstname\":\"{firstname}\",\n \"lastname\":\"{firstname}\",\n \"username\":\"{username}\",\n \"attributes\":[\n {\n \"name\":\"EmployeeID\",\n \"value\":\"0000\"\n },\n {\n \"name\":\"Custom\",\n \"value\":\"attribute\"\n }\n ]\n }\n]'\n``` .Description The endpoint allows you to create a bulk job to asynchronously create users.\nSee [create a System User](https://docs.jumpcloud.com/api/1.0/index.html#operation/systemusers_post)\nfor the full list of attributes.\n\n#### Default User State\nThe `state` of each user in the request can be explicitly passed in or\nomitted. If `state` is omitted, then the user will get created\nusing the value returned from the\n[Get an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organizations_get)\nendpoint. The default user state for bulk created users depends on the\n`creation-source` header. For `creation-source:jumpcloud:bulk` the\ndefault state is stored in `settings.newSystemUserStateDefaults.csvImport`.\nFor other `creation-source` header values, the default state is stored in\n`settings.newSystemUserStateDefaults.applicationImport`\n\nThese default state values can be changed in the admin portal settings\nor by using the\n[create an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organization_put)\nendpoint.\n\n#### Sample Request\n\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/bulk/users \\\n-H 'Accept: application/json' \\\n-H 'Content-Type: application/json' \\\n-H 'x-api-key: {API_KEY}' \\\n-d '[\n {\n \"email\":\"{email}\",\n \"firstname\":\"{firstname}\",\n \"lastname\":\"{firstname}\",\n \"username\":\"{username}\",\n \"attributes\":[\n {\n \"name\":\"EmployeeID\",\n \"value\":\"0000\"\n },\n {\n \"name\":\"Custom\",\n \"value\":\"attribute\"\n }\n ]\n }\n]'\n``` .Example {{ Add code here }} .Example {{ Add code here }} .Inputs System.Collections.Generic.List`1[[JumpCloud.SDK.V2.Models.IBulkUserCreate, JumpCloud.SDK.V2.private, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]] .Outputs JumpCloud.SDK.V2.Models.IJobIdResult .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. BODY <List<IBulkUserCreate>>: Array of bulk-user-create [AccountLocked <Boolean?>]: [Activated <Boolean?>]: [Addresses <List<IBulkUserCreateAddressesItem>>]: [Country <String>]: [ExtendedAddress <String>]: [Locality <String>]: [PoBox <String>]: [PostalCode <String>]: [Region <String>]: [StreetAddress <String>]: [Type <String>]: [AllowPublicKey <Boolean?>]: [AlternateEmail <String>]: [Attributes <List<IBulkUserCreateAttributesItem>>]: [Name <String>]: [Value <String>]: [Company <String>]: [CostCenter <String>]: [Department <String>]: [Description <String>]: [DisableDeviceMaxLoginAttempts <Boolean?>]: [Displayname <String>]: [Email <String>]: [EmployeeIdentifier <String>]: Must be unique per user. [EmployeeType <String>]: [EnableManagedUid <Boolean?>]: [EnableUserPortalMultifactor <Boolean?>]: [ExternalDn <String>]: [ExternalPasswordExpirationDate <DateTime?>]: [ExternalSourceType <String>]: [ExternallyManaged <Boolean?>]: [Firstname <String>]: [JobTitle <String>]: [Lastname <String>]: [LdapBindingUser <Boolean?>]: [Location <String>]: [ManagedAppleId <String>]: [Manager <String>]: Relation with another systemuser to identify the last as a manager. [MfaConfigured <Boolean?>]: [MfaExclusion <Boolean?>]: [MfaExclusionDays <Int32?>]: [MfaExclusionUntil <DateTime?>]: [Middlename <String>]: [Password <String>]: [PasswordNeverExpires <Boolean?>]: [PasswordlessSudo <Boolean?>]: [PhoneNumbers <List<IBulkUserCreatePhoneNumbersItem>>]: [Number <String>]: [Type <String>]: [PublicKey <String>]: [RecoveryEmailAddress <String>]: [Relationships <List<IBulkUserCreateRelationshipsItem>>]: [Type <String>]: [Value <String>]: [SambaServiceUser <Boolean?>]: [State <String>]: [Sudo <Boolean?>]: [Suspended <Boolean?>]: [UnixGuid <Int32?>]: [UnixUid <Int32?>]: [Username <String>]: .Link https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/New-JcSdkInternalBulkUser.md #> function New-JcSdkInternalBulkUser { [OutputType([JumpCloud.SDK.V2.Models.IJobIdResult])] [CmdletBinding(DefaultParameterSetName='Create', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] [JumpCloud.SDK.V2.Category('Uri')] [System.String] # Region for JumpCloud API host. # Use 'console' for US or 'console.eu' for EU. ${ConsoleHost}, [Parameter()] [JumpCloud.SDK.V2.Category('Query')] [System.Management.Automation.SwitchParameter] # An option indicating whether to suppress the job results email that will # otherwise be sent to the Administrator who created the job. # If true, the # email won't be sent. # If omitted or false, the email will be sent. ${SuppressEmail}, [Parameter()] [JumpCloud.SDK.V2.PSArgumentCompleterAttribute("jumpcloud:gapps", "jumpcloud:o365", "jumpcloud:workday", "jumpcloud:scim", "jumpcloud:bulk", "jumpcloud:custom_integration")] [JumpCloud.SDK.V2.Category('Header')] [System.String] # Defines the creation-source header for gapps, o365 and workdays requests. # If the header isn't sent, the default value is `jumpcloud:bulk`, if you send the header with a malformed value you receive a 400 error. ${CreationSource}, [Parameter(Mandatory, ValueFromPipeline)] [AllowEmptyCollection()] [JumpCloud.SDK.V2.Category('Body')] [JumpCloud.SDK.V2.Runtime.Info(Required, PossibleTypes=([JumpCloud.SDK.V2.Models.IBulkUserCreate]))] [System.Collections.Generic.List[JumpCloud.SDK.V2.Models.IBulkUserCreate]] # Array of bulk-user-create ${Body}, [Parameter(DontShow)] [JumpCloud.SDK.V2.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [JumpCloud.SDK.V2.Category('Runtime')] [JumpCloud.SDK.V2.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [JumpCloud.SDK.V2.Category('Runtime')] [JumpCloud.SDK.V2.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [JumpCloud.SDK.V2.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [JumpCloud.SDK.V2.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [JumpCloud.SDK.V2.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('JumpCloud.SDK.V2.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Create = 'JumpCloud.SDK.V2.private\New-JcSdkInternalBulkUser_Create'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) if ($wrappedCmd -eq $null) { $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { throw } } process { try { $steppablePipeline.Process($_) } catch { throw } } end { try { $steppablePipeline.End() } catch { throw } } } |