Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(SQL Server) Amazon Cognito - Create User PoolSee more Amazon Cognito ExamplesCreates a new Amazon Cognito user pool and sets the password policy for the pool. For more information, see https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_CreateUserPool.html
-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls. -- CREATE PROCEDURE ChilkatSample AS BEGIN DECLARE @hr int DECLARE @iTmp0 int -- Important: Do not use nvarchar(max). See the warning about using nvarchar(max). DECLARE @sTmp0 nvarchar(4000) -- This example requires the Chilkat API to have been previously unlocked. -- See Global Unlock Sample for sample code. DECLARE @rest int -- Use "Chilkat_9_5_0.Rest" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.Rest', @rest OUT IF @hr <> 0 BEGIN PRINT 'Failed to create ActiveX component' RETURN END DECLARE @success int DECLARE @authAws int -- Use "Chilkat_9_5_0.AuthAws" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.AuthAws', @authAws OUT EXEC sp_OASetProperty @authAws, 'AccessKey', 'AWS_ACCESS_KEY' EXEC sp_OASetProperty @authAws, 'SecretKey', 'AWS_SECRET_KEY' -- Don't forget to change the region to your particular region. (Also make the same change in the call to Connect below.) EXEC sp_OASetProperty @authAws, 'Region', 'us-west-2' EXEC sp_OASetProperty @authAws, 'ServiceName', 'cognito-idp' -- SetAuthAws causes Chilkat to automatically add the following headers: Authorization, X-Amz-Date EXEC sp_OAMethod @rest, 'SetAuthAws', @success OUT, @authAws -- URL: https://cognito-idp.us-west-2.amazonaws.com/ DECLARE @bTls int SELECT @bTls = 1 DECLARE @port int SELECT @port = 443 DECLARE @bAutoReconnect int SELECT @bAutoReconnect = 1 -- Use the same region as specified above. EXEC sp_OAMethod @rest, 'Connect', @success OUT, 'cognito-idp.us-west-2.amazonaws.com', @port, @bTls, @bAutoReconnect IF @success <> 1 BEGIN EXEC sp_OAGetProperty @rest, 'ConnectFailReason', @iTmp0 OUT PRINT 'ConnectFailReason: ' + @iTmp0 EXEC sp_OAGetProperty @rest, 'LastErrorText', @sTmp0 OUT PRINT @sTmp0 EXEC @hr = sp_OADestroy @rest EXEC @hr = sp_OADestroy @authAws RETURN END -- Note: The above code does not need to be repeatedly called for each REST request. -- The rest object can be setup once, and then many requests can be sent. Chilkat will automatically -- reconnect within a FullRequest* method as needed. It is only the very first connection that is explicitly -- made via the Connect method. -- Use this online tool to generate code from sample JSON: -- Generate Code to Create JSON -- The following JSON is sent in the request body. -- This example wil demonstrate creating a pool with many options specified. -- The only required JSON member is "PoolName". -- { -- "AccountRecoverySetting": { -- "RecoveryMechanisms": [ -- { -- "Name": "verified_phone_number", -- "Priority": 1 -- }, -- { -- "Name": "verified_email", -- "Priority": 2 -- } -- ] -- }, -- "AdminCreateUserConfig": { -- "AllowAdminCreateUserOnly": false, -- "InviteMessageTemplate": { -- "EmailMessage": "Your username is {username} and temporary password is {####}. ", -- "EmailSubject": "Your temporary password", -- "SMSMessage": "Your username is {username} and temporary password is {####}. " -- }, -- "TemporaryPasswordValidityDays": 7 -- }, -- "AutoVerifiedAttributes": [ -- "email", -- "phone_number" -- ], -- "EmailConfiguration": { -- "EmailSendingAccount": "DEVELOPER", -- "From": "joe@example.com", -- "ReplyToEmailAddress": "joe@example.com", -- "SourceArn": "arn:aws:ses:us-west-2:954491834127:identity/joe@example.com" -- }, -- "EmailVerificationMessage": "Your verification code is {####}. ", -- "EmailVerificationSubject": "Your verification code", -- "LambdaConfig": {}, -- "MfaConfiguration": "OFF", -- "PoolName": "MyTestPool", -- "Policies": { -- "PasswordPolicy": { -- "MinimumLength": 8, -- "RequireLowercase": true, -- "RequireNumbers": true, -- "RequireSymbols": true, -- "RequireUppercase": true, -- "TemporaryPasswordValidityDays": 7 -- } -- }, -- "Schema": [ -- { -- "AttributeDataType": "String", -- "DeveloperOnlyAttribute": false, -- "Mutable": false, -- "Name": "sub", -- "Required": true, -- "StringAttributeConstraints": { -- "MaxLength": "2048", -- "MinLength": "1" -- } -- }, -- { -- "AttributeDataType": "String", -- "DeveloperOnlyAttribute": false, -- "Mutable": true, -- "Name": "name", -- "Required": false, -- "StringAttributeConstraints": { -- "MaxLength": "2048", -- "MinLength": "0" -- } -- }, -- { -- "AttributeDataType": "String", -- "DeveloperOnlyAttribute": false, -- "Mutable": true, -- "Name": "given_name", -- "Required": false, -- "StringAttributeConstraints": { -- "MaxLength": "2048", -- "MinLength": "0" -- } -- }, -- { -- "AttributeDataType": "String", -- "DeveloperOnlyAttribute": false, -- "Mutable": true, -- "Name": "family_name", -- "Required": false, -- "StringAttributeConstraints": { -- "MaxLength": "2048", -- "MinLength": "0" -- } -- }, -- { -- "AttributeDataType": "String", -- "DeveloperOnlyAttribute": false, -- "Mutable": true, -- "Name": "middle_name", -- "Required": false, -- "StringAttributeConstraints": { -- "MaxLength": "2048", -- "MinLength": "0" -- } -- }, -- { -- "AttributeDataType": "String", -- "DeveloperOnlyAttribute": false, -- "Mutable": true, -- "Name": "nickname", -- "Required": false, -- "StringAttributeConstraints": { -- "MaxLength": "2048", -- "MinLength": "0" -- } -- }, -- { -- "AttributeDataType": "String", -- "DeveloperOnlyAttribute": false, -- "Mutable": true, -- "Name": "preferred_username", -- "Required": false, -- "StringAttributeConstraints": { -- "MaxLength": "2048", -- "MinLength": "0" -- } -- }, -- { -- "AttributeDataType": "String", -- "DeveloperOnlyAttribute": false, -- "Mutable": true, -- "Name": "profile", -- "Required": false, -- "StringAttributeConstraints": { -- "MaxLength": "2048", -- "MinLength": "0" -- } -- }, -- { -- "AttributeDataType": "String", -- "DeveloperOnlyAttribute": false, -- "Mutable": true, -- "Name": "picture", -- "Required": false, -- "StringAttributeConstraints": { -- "MaxLength": "2048", -- "MinLength": "0" -- } -- }, -- { -- "AttributeDataType": "String", -- "DeveloperOnlyAttribute": false, -- "Mutable": true, -- "Name": "website", -- "Required": false, -- "StringAttributeConstraints": { -- "MaxLength": "2048", -- "MinLength": "0" -- } -- }, -- { -- "AttributeDataType": "String", -- "DeveloperOnlyAttribute": false, -- "Mutable": true, -- "Name": "email", -- "Required": true, -- "StringAttributeConstraints": { -- "MaxLength": "2048", -- "MinLength": "0" -- } -- }, -- { -- "AttributeDataType": "Boolean", -- "DeveloperOnlyAttribute": false, -- "Mutable": true, -- "Name": "email_verified", -- "Required": false -- }, -- { -- "AttributeDataType": "String", -- "DeveloperOnlyAttribute": false, -- "Mutable": true, -- "Name": "gender", -- "Required": false, -- "StringAttributeConstraints": { -- "MaxLength": "2048", -- "MinLength": "0" -- } -- }, -- { -- "AttributeDataType": "String", -- "DeveloperOnlyAttribute": false, -- "Mutable": true, -- "Name": "birthdate", -- "Required": false, -- "StringAttributeConstraints": { -- "MaxLength": "10", -- "MinLength": "10" -- } -- }, -- { -- "AttributeDataType": "String", -- "DeveloperOnlyAttribute": false, -- "Mutable": true, -- "Name": "zoneinfo", -- "Required": false, -- "StringAttributeConstraints": { -- "MaxLength": "2048", -- "MinLength": "0" -- } -- }, -- { -- "AttributeDataType": "String", -- "DeveloperOnlyAttribute": false, -- "Mutable": true, -- "Name": "locale", -- "Required": false, -- "StringAttributeConstraints": { -- "MaxLength": "2048", -- "MinLength": "0" -- } -- }, -- { -- "AttributeDataType": "String", -- "DeveloperOnlyAttribute": false, -- "Mutable": true, -- "Name": "phone_number", -- "Required": false, -- "StringAttributeConstraints": { -- "MaxLength": "2048", -- "MinLength": "0" -- } -- }, -- { -- "AttributeDataType": "String", -- "DeveloperOnlyAttribute": false, -- "Mutable": true, -- "Name": "address", -- "Required": false, -- "StringAttributeConstraints": { -- "MaxLength": "2048", -- "MinLength": "0" -- } -- }, -- { -- "AttributeDataType": "Number", -- "DeveloperOnlyAttribute": false, -- "Mutable": true, -- "Name": "updated_at", -- "NumberAttributeConstraints": { -- "MinValue": "0" -- }, -- "Required": false -- } -- ], -- "SmsAuthenticationMessage": "Your verification code is {####}. ", -- "SmsConfiguration": { -- "ExternalId": "94b17737-216b-4cf7-a29e-17e990e91300", -- "SnsCallerArn": "arn:aws:iam::954491834127:role/service-role/chilkat-SMS-Role" -- }, -- "SmsVerificationMessage": "Your verification code is {####}. ", -- "UsernameConfiguration": { -- "CaseSensitive": false -- }, -- "VerificationMessageTemplate": { -- "DefaultEmailOption": "CONFIRM_WITH_CODE", -- "EmailMessage": "Your verification code is {####}. ", -- "EmailSubject": "Your verification code", -- "SmsMessage": "Your verification code is {####}. " -- } -- } -- DECLARE @json int -- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @json OUT EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'AccountRecoverySetting.RecoveryMechanisms[0].Name', 'verified_phone_number' EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'AccountRecoverySetting.RecoveryMechanisms[0].Priority', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'AccountRecoverySetting.RecoveryMechanisms[1].Name', 'verified_email' EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'AccountRecoverySetting.RecoveryMechanisms[1].Priority', 2 EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'AdminCreateUserConfig.AllowAdminCreateUserOnly', 0 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'AdminCreateUserConfig.InviteMessageTemplate.EmailMessage', 'Your username is {username} and temporary password is {####}. ' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'AdminCreateUserConfig.InviteMessageTemplate.EmailSubject', 'Your temporary password' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'AdminCreateUserConfig.InviteMessageTemplate.SMSMessage', 'Your username is {username} and temporary password is {####}. ' EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'AdminCreateUserConfig.TemporaryPasswordValidityDays', 7 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'AutoVerifiedAttributes[0]', 'email' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'AutoVerifiedAttributes[1]', 'phone_number' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'EmailConfiguration.EmailSendingAccount', 'DEVELOPER' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'EmailConfiguration.From', 'joe@example.com' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'EmailConfiguration.ReplyToEmailAddress', 'joe@example.com' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'EmailConfiguration.SourceArn', 'arn:aws:ses:us-west-2:954491834127:identity/joe@example.com' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'EmailVerificationMessage', 'Your verification code is {####}. ' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'EmailVerificationSubject', 'Your verification code' EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'LambdaConfig' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'MfaConfiguration', 'OFF' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'PoolName', 'MyTestPool' EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'Policies.PasswordPolicy.MinimumLength', 8 EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Policies.PasswordPolicy.RequireLowercase', 1 EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Policies.PasswordPolicy.RequireNumbers', 1 EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Policies.PasswordPolicy.RequireSymbols', 1 EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Policies.PasswordPolicy.RequireUppercase', 1 EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'Policies.PasswordPolicy.TemporaryPasswordValidityDays', 7 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[0].AttributeDataType', 'String' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[0].DeveloperOnlyAttribute', 0 EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[0].Mutable', 0 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[0].Name', 'sub' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[0].Required', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[0].StringAttributeConstraints.MaxLength', '2048' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[0].StringAttributeConstraints.MinLength', '1' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[1].AttributeDataType', 'String' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[1].DeveloperOnlyAttribute', 0 EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[1].Mutable', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[1].Name', 'name' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[1].Required', 0 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[1].StringAttributeConstraints.MaxLength', '2048' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[1].StringAttributeConstraints.MinLength', '0' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[2].AttributeDataType', 'String' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[2].DeveloperOnlyAttribute', 0 EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[2].Mutable', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[2].Name', 'given_name' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[2].Required', 0 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[2].StringAttributeConstraints.MaxLength', '2048' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[2].StringAttributeConstraints.MinLength', '0' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[3].AttributeDataType', 'String' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[3].DeveloperOnlyAttribute', 0 EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[3].Mutable', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[3].Name', 'family_name' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[3].Required', 0 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[3].StringAttributeConstraints.MaxLength', '2048' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[3].StringAttributeConstraints.MinLength', '0' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[4].AttributeDataType', 'String' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[4].DeveloperOnlyAttribute', 0 EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[4].Mutable', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[4].Name', 'middle_name' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[4].Required', 0 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[4].StringAttributeConstraints.MaxLength', '2048' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[4].StringAttributeConstraints.MinLength', '0' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[5].AttributeDataType', 'String' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[5].DeveloperOnlyAttribute', 0 EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[5].Mutable', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[5].Name', 'nickname' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[5].Required', 0 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[5].StringAttributeConstraints.MaxLength', '2048' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[5].StringAttributeConstraints.MinLength', '0' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[6].AttributeDataType', 'String' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[6].DeveloperOnlyAttribute', 0 EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[6].Mutable', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[6].Name', 'preferred_username' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[6].Required', 0 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[6].StringAttributeConstraints.MaxLength', '2048' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[6].StringAttributeConstraints.MinLength', '0' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[7].AttributeDataType', 'String' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[7].DeveloperOnlyAttribute', 0 EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[7].Mutable', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[7].Name', 'profile' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[7].Required', 0 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[7].StringAttributeConstraints.MaxLength', '2048' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[7].StringAttributeConstraints.MinLength', '0' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[8].AttributeDataType', 'String' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[8].DeveloperOnlyAttribute', 0 EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[8].Mutable', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[8].Name', 'picture' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[8].Required', 0 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[8].StringAttributeConstraints.MaxLength', '2048' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[8].StringAttributeConstraints.MinLength', '0' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[9].AttributeDataType', 'String' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[9].DeveloperOnlyAttribute', 0 EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[9].Mutable', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[9].Name', 'website' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[9].Required', 0 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[9].StringAttributeConstraints.MaxLength', '2048' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[9].StringAttributeConstraints.MinLength', '0' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[10].AttributeDataType', 'String' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[10].DeveloperOnlyAttribute', 0 EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[10].Mutable', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[10].Name', 'email' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[10].Required', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[10].StringAttributeConstraints.MaxLength', '2048' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[10].StringAttributeConstraints.MinLength', '0' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[11].AttributeDataType', 'Boolean' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[11].DeveloperOnlyAttribute', 0 EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[11].Mutable', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[11].Name', 'email_verified' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[11].Required', 0 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[12].AttributeDataType', 'String' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[12].DeveloperOnlyAttribute', 0 EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[12].Mutable', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[12].Name', 'gender' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[12].Required', 0 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[12].StringAttributeConstraints.MaxLength', '2048' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[12].StringAttributeConstraints.MinLength', '0' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[13].AttributeDataType', 'String' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[13].DeveloperOnlyAttribute', 0 EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[13].Mutable', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[13].Name', 'birthdate' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[13].Required', 0 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[13].StringAttributeConstraints.MaxLength', '10' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[13].StringAttributeConstraints.MinLength', '10' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[14].AttributeDataType', 'String' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[14].DeveloperOnlyAttribute', 0 EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[14].Mutable', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[14].Name', 'zoneinfo' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[14].Required', 0 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[14].StringAttributeConstraints.MaxLength', '2048' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[14].StringAttributeConstraints.MinLength', '0' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[15].AttributeDataType', 'String' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[15].DeveloperOnlyAttribute', 0 EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[15].Mutable', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[15].Name', 'locale' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[15].Required', 0 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[15].StringAttributeConstraints.MaxLength', '2048' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[15].StringAttributeConstraints.MinLength', '0' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[16].AttributeDataType', 'String' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[16].DeveloperOnlyAttribute', 0 EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[16].Mutable', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[16].Name', 'phone_number' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[16].Required', 0 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[16].StringAttributeConstraints.MaxLength', '2048' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[16].StringAttributeConstraints.MinLength', '0' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[17].AttributeDataType', 'String' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[17].DeveloperOnlyAttribute', 0 EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[17].Mutable', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[17].Name', 'address' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[17].Required', 0 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[17].StringAttributeConstraints.MaxLength', '2048' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[17].StringAttributeConstraints.MinLength', '0' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[18].AttributeDataType', 'Number' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[18].DeveloperOnlyAttribute', 0 EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[18].Mutable', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[18].Name', 'updated_at' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Schema[18].NumberAttributeConstraints.MinValue', '0' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'Schema[18].Required', 0 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'SmsAuthenticationMessage', 'Your verification code is {####}. ' -- Use your own value here: EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'SmsConfiguration.ExternalId', '94b17737-216b-4cf7-a29e-17e990e91300' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'SmsConfiguration.SnsCallerArn', 'arn:aws:iam::954491834127:role/service-role/chilkat-SMS-Role' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'SmsVerificationMessage', 'Your verification code is {####}. ' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'UsernameConfiguration.CaseSensitive', 0 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'VerificationMessageTemplate.DefaultEmailOption', 'CONFIRM_WITH_CODE' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'VerificationMessageTemplate.EmailMessage', 'Your verification code is {####}. ' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'VerificationMessageTemplate.EmailSubject', 'Your verification code' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'VerificationMessageTemplate.SmsMessage', 'Your verification code is {####}. ' EXEC sp_OAMethod @rest, 'AddHeader', @success OUT, 'Content-Type', 'application/x-amz-json-1.0' EXEC sp_OAMethod @rest, 'AddHeader', @success OUT, 'X-Amz-Target', 'AWSCognitoIdentityProviderService.CreateUserPool' EXEC sp_OAMethod @rest, 'AddHeader', @success OUT, 'Accept-Encoding', 'identity' DECLARE @sbRequestBody int -- Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.StringBuilder', @sbRequestBody OUT EXEC sp_OAMethod @json, 'EmitSb', @success OUT, @sbRequestBody DECLARE @sbResponseBody int -- Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.StringBuilder', @sbResponseBody OUT EXEC sp_OAMethod @rest, 'FullRequestSb', @success OUT, 'POST', '/', @sbRequestBody, @sbResponseBody IF @success <> 1 BEGIN EXEC sp_OAGetProperty @rest, 'LastErrorText', @sTmp0 OUT PRINT @sTmp0 EXEC @hr = sp_OADestroy @rest EXEC @hr = sp_OADestroy @authAws EXEC @hr = sp_OADestroy @json EXEC @hr = sp_OADestroy @sbRequestBody EXEC @hr = sp_OADestroy @sbResponseBody RETURN END DECLARE @respStatusCode int EXEC sp_OAGetProperty @rest, 'ResponseStatusCode', @respStatusCode OUT PRINT 'response status code = ' + @respStatusCode IF @respStatusCode <> 200 BEGIN PRINT 'Response Status Code = ' + @respStatusCode PRINT 'Response Header:' EXEC sp_OAGetProperty @rest, 'ResponseHeader', @sTmp0 OUT PRINT @sTmp0 PRINT 'Response Body:' EXEC sp_OAMethod @sbResponseBody, 'GetAsString', @sTmp0 OUT PRINT @sTmp0 EXEC @hr = sp_OADestroy @rest EXEC @hr = sp_OADestroy @authAws EXEC @hr = sp_OADestroy @json EXEC @hr = sp_OADestroy @sbRequestBody EXEC @hr = sp_OADestroy @sbResponseBody RETURN END DECLARE @jsonResponse int -- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @jsonResponse OUT EXEC sp_OAMethod @jsonResponse, 'LoadSb', @success OUT, @sbResponseBody EXEC sp_OASetProperty @jsonResponse, 'EmitCompact', 0 EXEC sp_OAMethod @jsonResponse, 'Emit', @sTmp0 OUT PRINT @sTmp0 -- The response is similar to the response at Cognito Describe User Pool EXEC @hr = sp_OADestroy @rest EXEC @hr = sp_OADestroy @authAws EXEC @hr = sp_OADestroy @json EXEC @hr = sp_OADestroy @sbRequestBody EXEC @hr = sp_OADestroy @sbResponseBody EXEC @hr = sp_OADestroy @jsonResponse END GO |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.