diff --git a/package-lock.json b/package-lock.json
index 7f79ae6e8..ccc968bd7 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -2,18 +2,30 @@
"name": "okta-sdk-dotnet",
"version": "0.0.0",
"lockfileVersion": 1,
+ "requires": true,
"dependencies": {
"@okta/openapi": {
- "version": "0.3.0",
- "resolved": "https://registry.npmjs.org/@okta/openapi/-/openapi-0.3.0.tgz",
- "integrity": "sha1-FycTtv1lk/svzvWsYLPcqNZvjMA=",
- "dev": true
+ "version": "0.8.0",
+ "resolved": "https://registry.npmjs.org/@okta/openapi/-/openapi-0.8.0.tgz",
+ "integrity": "sha1-f8L+wvObHyFyI1nN9a4tAPm7LaM=",
+ "dev": true,
+ "requires": {
+ "commander": "2.9.0",
+ "fs-extra": "3.0.1",
+ "handlebars": "4.0.8",
+ "json-stable-stringify": "1.0.1"
+ }
},
"align-text": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz",
"integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=",
- "dev": true
+ "dev": true,
+ "requires": {
+ "kind-of": "3.2.2",
+ "longest": "1.0.1",
+ "repeat-string": "1.6.1"
+ }
},
"amdefine": {
"version": "1.0.1",
@@ -39,7 +51,11 @@
"resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz",
"integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=",
"dev": true,
- "optional": true
+ "optional": true,
+ "requires": {
+ "align-text": "0.1.4",
+ "lazy-cache": "1.0.4"
+ }
},
"cliui": {
"version": "2.1.0",
@@ -47,6 +63,11 @@
"integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=",
"dev": true,
"optional": true,
+ "requires": {
+ "center-align": "0.1.3",
+ "right-align": "0.1.3",
+ "wordwrap": "0.0.2"
+ },
"dependencies": {
"wordwrap": {
"version": "0.0.2",
@@ -61,7 +82,10 @@
"version": "2.9.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz",
"integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=",
- "dev": true
+ "dev": true,
+ "requires": {
+ "graceful-readlink": "1.0.1"
+ }
},
"decamelize": {
"version": "1.2.0",
@@ -74,7 +98,12 @@
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-3.0.1.tgz",
"integrity": "sha1-N5TzeMWLNC6n27sjCVEJxLO2IpE=",
- "dev": true
+ "dev": true,
+ "requires": {
+ "graceful-fs": "4.1.11",
+ "jsonfile": "3.0.1",
+ "universalify": "0.1.1"
+ }
},
"graceful-fs": {
"version": "4.1.11",
@@ -92,25 +121,37 @@
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.8.tgz",
"integrity": "sha1-Irh1zT8ObL6jAxTxROgrx6cv9CA=",
- "dev": true
+ "dev": true,
+ "requires": {
+ "async": "1.5.2",
+ "optimist": "0.6.1",
+ "source-map": "0.4.4",
+ "uglify-js": "2.8.29"
+ }
},
"is-buffer": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz",
- "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=",
+ "version": "1.1.6",
+ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
+ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==",
"dev": true
},
"json-stable-stringify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz",
"integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=",
- "dev": true
+ "dev": true,
+ "requires": {
+ "jsonify": "0.0.0"
+ }
},
"jsonfile": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-3.0.0.tgz",
- "integrity": "sha1-kufHRE5f/V+jLmqa6LhQNN+DR9A=",
- "dev": true
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-3.0.1.tgz",
+ "integrity": "sha1-pezG9l9T9mLEQVx2daAzHQmS7GY=",
+ "dev": true,
+ "requires": {
+ "graceful-fs": "4.1.11"
+ }
},
"jsonify": {
"version": "0.0.0",
@@ -122,7 +163,10 @@
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
"integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true
+ "dev": true,
+ "requires": {
+ "is-buffer": "1.1.6"
+ }
},
"lazy-cache": {
"version": "1.0.4",
@@ -153,7 +197,11 @@
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",
"integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=",
- "dev": true
+ "dev": true,
+ "requires": {
+ "minimist": "0.0.10",
+ "wordwrap": "0.0.3"
+ }
},
"repeat-string": {
"version": "1.6.1",
@@ -166,13 +214,19 @@
"resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz",
"integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=",
"dev": true,
- "optional": true
+ "optional": true,
+ "requires": {
+ "align-text": "0.1.4"
+ }
},
"source-map": {
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz",
"integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=",
- "dev": true
+ "dev": true,
+ "requires": {
+ "amdefine": "1.0.1"
+ }
},
"uglify-js": {
"version": "2.8.29",
@@ -180,11 +234,16 @@
"integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=",
"dev": true,
"optional": true,
+ "requires": {
+ "source-map": "0.5.7",
+ "uglify-to-browserify": "1.0.2",
+ "yargs": "3.10.0"
+ },
"dependencies": {
"source-map": {
- "version": "0.5.6",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz",
- "integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI=",
+ "version": "0.5.7",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
+ "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
"dev": true,
"optional": true
}
@@ -198,9 +257,9 @@
"optional": true
},
"universalify": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.0.tgz",
- "integrity": "sha1-nrHEZR3rzGcMyU8adXYjMruWd3g=",
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz",
+ "integrity": "sha1-+nG63UQ3r0wUiEHjs7Fl+enlkLc=",
"dev": true
},
"window-size": {
@@ -221,7 +280,13 @@
"resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz",
"integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=",
"dev": true,
- "optional": true
+ "optional": true,
+ "requires": {
+ "camelcase": "1.2.1",
+ "cliui": "2.1.0",
+ "decamelize": "1.2.0",
+ "window-size": "0.1.0"
+ }
}
}
}
diff --git a/package.json b/package.json
index 41f81e3ea..9c6a23ede 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,6 @@
{
"name": "okta-sdk-dotnet",
"version": "0.0.0",
- "main": "index.js",
"private": true,
"scripts": {
"generate": "okta-sdk-generator -o src/Okta.Sdk/ -t templates",
@@ -9,14 +8,14 @@
},
"repository": {
"type": "git",
- "url": "git+https://github.com/okta/oktasdk-csharp.git"
+ "url": "git+https://github.com/okta/oktasdk-sdk-dotnet.git"
},
"bugs": {
- "url": "https://github.com/okta/oktasdk-csharp/issues"
+ "url": "https://github.com/okta/oktasdk-sdk-dotnet/issues"
},
- "homepage": "https://github.com/okta/oktasdk-csharp#readme",
+ "homepage": "https://github.com/okta/oktasdk-sdk-dotnet#readme",
"devDependencies": {
- "@okta/openapi": "0.3.0",
+ "@okta/openapi": "0.8.0",
"json-stable-stringify": "^1.0.1",
"lodash": "^4.17.4"
}
diff --git a/src/Okta.Sdk.IntegrationTests/FactorScenarios.cs b/src/Okta.Sdk.IntegrationTests/FactorScenarios.cs
new file mode 100644
index 000000000..43a91c0de
--- /dev/null
+++ b/src/Okta.Sdk.IntegrationTests/FactorScenarios.cs
@@ -0,0 +1,94 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using FluentAssertions;
+using Xunit;
+
+namespace Okta.Sdk.IntegrationTests
+{
+ [Collection(nameof(ScenariosCollection))]
+ public class FactorScenarios : ScenarioGroup
+ {
+ [Fact]
+ public async Task CreateSecurityQuestionFactor()
+ {
+ var client = GetClient("factor-securityquestion-create");
+
+ var profile = new UserProfile
+ {
+ FirstName = "Jill",
+ LastName = "Factor-SecurityQuestion",
+ Email = "jill-factor-securityquestion@example.com",
+ Login = "jill-factor-securityquestion@example.com",
+ };
+ profile["nickName"] = "jill-factor-securityquestion";
+
+ var createdUser = await client.Users.CreateUserAsync(new CreateUserWithPasswordOptions
+ {
+ Profile = profile,
+ Password = "Abcd1234",
+ });
+
+ try
+ {
+ await createdUser.AddFactorAsync(new AddSecurityQuestionFactorOptions
+ {
+ Question = "disliked_food",
+ Answer = "mayonnaise",
+ });
+
+ var factors = await createdUser.ListFactors().ToArray();
+ factors.Count().Should().Be(1);
+
+ var securityQuestionFactor = await createdUser.ListFactors().OfType().FirstOrDefault();
+ securityQuestionFactor.Should().NotBeNull();
+ securityQuestionFactor.Profile.Question.Should().Be("disliked_food");
+ securityQuestionFactor.Profile.QuestionText.Should().NotBeNullOrEmpty();
+ }
+ finally
+ {
+ await createdUser.DeactivateAsync();
+ await createdUser.DeactivateOrDeleteAsync();
+ }
+ }
+
+ [Fact]
+ public async Task ListFactorsForNewUser()
+ {
+ var client = GetClient("list-factors");
+
+ var profile = new UserProfile
+ {
+ FirstName = "Jack",
+ LastName = "List-Factors",
+ Email = "jack-list-factors@example.com",
+ Login = "jack-list-factors@example.com",
+ };
+ profile["nickName"] = "jack-list-users";
+
+ var createdUser = await client.Users.CreateUserAsync(new CreateUserWithPasswordOptions
+ {
+ Profile = profile,
+ Password = "Abcd1234",
+ });
+
+ try
+ {
+ var factors = await createdUser.Factors.ToArray();
+ factors.Count().Should().Be(0);
+ }
+ finally
+ {
+ await createdUser.DeactivateAsync();
+ await createdUser.DeactivateOrDeleteAsync();
+ }
+ }
+ }
+}
diff --git a/src/Okta.Sdk.IntegrationTests/GroupScenarios.cs b/src/Okta.Sdk.IntegrationTests/GroupScenarios.cs
index cebf4e335..c73f0710e 100644
--- a/src/Okta.Sdk.IntegrationTests/GroupScenarios.cs
+++ b/src/Okta.Sdk.IntegrationTests/GroupScenarios.cs
@@ -4,10 +4,10 @@
//
using System;
+using System.Linq;
using System.Threading.Tasks;
using FluentAssertions;
using Xunit;
-using System.Linq;
namespace Okta.Sdk.IntegrationTests
{
diff --git a/src/Okta.Sdk.UnitTests/CollectionOfFactorsShould.cs b/src/Okta.Sdk.UnitTests/CollectionOfFactorsShould.cs
new file mode 100644
index 000000000..ed4d111fa
--- /dev/null
+++ b/src/Okta.Sdk.UnitTests/CollectionOfFactorsShould.cs
@@ -0,0 +1,68 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using FluentAssertions;
+using Microsoft.Extensions.Logging.Abstractions;
+using Okta.Sdk.Internal;
+using Xunit;
+
+namespace Okta.Sdk.UnitTests
+{
+ public class CollectionOfFactorsShould
+ {
+ private static readonly List AllFactors = new List()
+ {
+ new ResourceCreator().With(
+ (f => f.FactorType, FactorType.Question.ToString()), // todo removing ToString breaks the mocked RequestExecutor
+ (f => f.Provider, "OKTA"),
+ (f => f.Profile, new SecurityQuestionFactorProfile { Question = "disliked_food" })),
+ };
+
+ [Fact]
+ public async Task RetrieveQuestionFactor()
+ {
+ var mockRequestExecutor = new MockedCollectionRequestExecutor(pageSize: 2, items: AllFactors);
+ var dataStore = new DefaultDataStore(
+ mockRequestExecutor,
+ new DefaultSerializer(),
+ new ResourceFactory(null, null),
+ NullLogger.Instance);
+
+ var collection = new CollectionClient(
+ dataStore,
+ new HttpRequest { Uri = "http://mock-collection.dev" },
+ new RequestContext());
+
+ var retrievedItems = await collection.ToArray();
+ var securityQuestionFactor = retrievedItems.OfType().FirstOrDefault();
+ securityQuestionFactor.Should().NotBeNull();
+ }
+
+ [Fact]
+ public async Task RetrieveQuestionFactorAsInterface()
+ {
+ var mockRequestExecutor = new MockedCollectionRequestExecutor(pageSize: 2, items: AllFactors);
+ var dataStore = new DefaultDataStore(
+ mockRequestExecutor,
+ new DefaultSerializer(),
+ new ResourceFactory(null, null),
+ NullLogger.Instance);
+
+ var collection = new CollectionClient(
+ dataStore,
+ new HttpRequest { Uri = "http://mock-collection.dev" },
+ new RequestContext());
+
+ var retrievedItems = await collection.ToArray();
+ var securityQuestionFactor = retrievedItems.OfType().FirstOrDefault();
+ securityQuestionFactor.Should().NotBeNull();
+ }
+ }
+}
diff --git a/src/Okta.Sdk/AddCallFactorOptions.cs b/src/Okta.Sdk/AddCallFactorOptions.cs
new file mode 100644
index 000000000..5fff239fa
--- /dev/null
+++ b/src/Okta.Sdk/AddCallFactorOptions.cs
@@ -0,0 +1,18 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Okta.Sdk
+{
+ public sealed class AddCallFactorOptions
+ {
+ public string PhoneExtension { get; set; }
+
+ public string PhoneNumber { get; set; }
+ }
+}
diff --git a/src/Okta.Sdk/AddEmailFactorOptions.cs b/src/Okta.Sdk/AddEmailFactorOptions.cs
new file mode 100644
index 000000000..d1c8b391c
--- /dev/null
+++ b/src/Okta.Sdk/AddEmailFactorOptions.cs
@@ -0,0 +1,16 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Okta.Sdk
+{
+ public sealed class AddEmailFactorOptions
+ {
+ public string Email { get; set; }
+ }
+}
diff --git a/src/Okta.Sdk/AddHardwareFactorOptions.cs b/src/Okta.Sdk/AddHardwareFactorOptions.cs
new file mode 100644
index 000000000..33a44e007
--- /dev/null
+++ b/src/Okta.Sdk/AddHardwareFactorOptions.cs
@@ -0,0 +1,18 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Okta.Sdk
+{
+ public sealed class AddHardwareFactorOptions
+ {
+ public string PassCode { get; set; }
+
+ public FactorProvider Provider { get; set; }
+ }
+}
diff --git a/src/Okta.Sdk/AddPushFactorOptions.cs b/src/Okta.Sdk/AddPushFactorOptions.cs
new file mode 100644
index 000000000..42d111d08
--- /dev/null
+++ b/src/Okta.Sdk/AddPushFactorOptions.cs
@@ -0,0 +1,15 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Okta.Sdk
+{
+ public sealed class AddPushFactorOptions
+ {
+ }
+}
diff --git a/src/Okta.Sdk/AddSecurityQuestionFactorOptions.cs b/src/Okta.Sdk/AddSecurityQuestionFactorOptions.cs
new file mode 100644
index 000000000..832526b34
--- /dev/null
+++ b/src/Okta.Sdk/AddSecurityQuestionFactorOptions.cs
@@ -0,0 +1,18 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Okta.Sdk
+{
+ public sealed class AddSecurityQuestionFactorOptions
+ {
+ public string Question { get; set; }
+
+ public string Answer { get; set; }
+ }
+}
diff --git a/src/Okta.Sdk/AddSmsFactorOptions.cs b/src/Okta.Sdk/AddSmsFactorOptions.cs
new file mode 100644
index 000000000..383cf7b05
--- /dev/null
+++ b/src/Okta.Sdk/AddSmsFactorOptions.cs
@@ -0,0 +1,16 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Okta.Sdk
+{
+ public sealed class AddSmsFactorOptions
+ {
+ public string PhoneNumber { get; set; }
+ }
+}
diff --git a/src/Okta.Sdk/AddTokenFactorOptions.cs b/src/Okta.Sdk/AddTokenFactorOptions.cs
new file mode 100644
index 000000000..7be089895
--- /dev/null
+++ b/src/Okta.Sdk/AddTokenFactorOptions.cs
@@ -0,0 +1,22 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Okta.Sdk
+{
+ public sealed class AddTokenFactorOptions
+ {
+ public string CredentialId { get; set; }
+
+ public string PassCode { get; set; }
+
+ public string NextPassCode { get; set; }
+
+ public FactorProvider Provider { get; set; }
+ }
+}
diff --git a/src/Okta.Sdk/AddTotpFactorOptions.cs b/src/Okta.Sdk/AddTotpFactorOptions.cs
new file mode 100644
index 000000000..ddd60c97d
--- /dev/null
+++ b/src/Okta.Sdk/AddTotpFactorOptions.cs
@@ -0,0 +1,16 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Okta.Sdk
+{
+ public sealed class AddTotpFactorOptions
+ {
+ public FactorProvider Provider { get; set; }
+ }
+}
diff --git a/src/Okta.Sdk/CreateUserWithRecoveryQuestionOptions.cs b/src/Okta.Sdk/CreateUserWithRecoveryQuestionOptions.cs
index c82461ce4..00be859df 100644
--- a/src/Okta.Sdk/CreateUserWithRecoveryQuestionOptions.cs
+++ b/src/Okta.Sdk/CreateUserWithRecoveryQuestionOptions.cs
@@ -41,4 +41,4 @@ public class CreateUserWithRecoveryQuestionOptions
/// The new user's recovery answer.
public string RecoveryAnswer { get; set; }
}
-}
\ No newline at end of file
+}
diff --git a/src/Okta.Sdk/Generated/AppLink.Generated.cs b/src/Okta.Sdk/Generated/AppLink.Generated.cs
index 2738d6bb2..e351b5f59 100644
--- a/src/Okta.Sdk/Generated/AppLink.Generated.cs
+++ b/src/Okta.Sdk/Generated/AppLink.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/AuthenticationProvider.Generated.cs b/src/Okta.Sdk/Generated/AuthenticationProvider.Generated.cs
index 4e36111d8..04ca654c2 100644
--- a/src/Okta.Sdk/Generated/AuthenticationProvider.Generated.cs
+++ b/src/Okta.Sdk/Generated/AuthenticationProvider.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/AuthenticationProviderType.Generated.cs b/src/Okta.Sdk/Generated/AuthenticationProviderType.Generated.cs
index cbafabb90..4d96b3b64 100644
--- a/src/Okta.Sdk/Generated/AuthenticationProviderType.Generated.cs
+++ b/src/Okta.Sdk/Generated/AuthenticationProviderType.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
namespace Okta.Sdk
{
diff --git a/src/Okta.Sdk/Generated/CallFactor.Generated.cs b/src/Okta.Sdk/Generated/CallFactor.Generated.cs
new file mode 100644
index 000000000..69b8c395a
--- /dev/null
+++ b/src/Okta.Sdk/Generated/CallFactor.Generated.cs
@@ -0,0 +1,27 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Okta.Sdk.Internal;
+
+namespace Okta.Sdk
+{
+ ///
+ public sealed partial class CallFactor : Factor, ICallFactor
+ {
+ ///
+ public new ICallFactorProfile Profile
+ {
+ get => GetResourceProperty("profile");
+ set => this["profile"] = value;
+ }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/CallFactorProfile.Generated.cs b/src/Okta.Sdk/Generated/CallFactorProfile.Generated.cs
new file mode 100644
index 000000000..467ad1d26
--- /dev/null
+++ b/src/Okta.Sdk/Generated/CallFactorProfile.Generated.cs
@@ -0,0 +1,34 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Okta.Sdk.Internal;
+
+namespace Okta.Sdk
+{
+ ///
+ public sealed partial class CallFactorProfile : FactorProfile, ICallFactorProfile
+ {
+ ///
+ public string PhoneExtension
+ {
+ get => GetStringProperty("phoneExtension");
+ set => this["phoneExtension"] = value;
+ }
+
+ ///
+ public string PhoneNumber
+ {
+ get => GetStringProperty("phoneNumber");
+ set => this["phoneNumber"] = value;
+ }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/ChangePasswordRequest.Generated.cs b/src/Okta.Sdk/Generated/ChangePasswordRequest.Generated.cs
index 2732a0961..71322bc8e 100644
--- a/src/Okta.Sdk/Generated/ChangePasswordRequest.Generated.cs
+++ b/src/Okta.Sdk/Generated/ChangePasswordRequest.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/EmailFactor.Generated.cs b/src/Okta.Sdk/Generated/EmailFactor.Generated.cs
new file mode 100644
index 000000000..b718392c1
--- /dev/null
+++ b/src/Okta.Sdk/Generated/EmailFactor.Generated.cs
@@ -0,0 +1,27 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Okta.Sdk.Internal;
+
+namespace Okta.Sdk
+{
+ ///
+ public sealed partial class EmailFactor : Factor, IEmailFactor
+ {
+ ///
+ public new IEmailFactorProfile Profile
+ {
+ get => GetResourceProperty("profile");
+ set => this["profile"] = value;
+ }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/EmailFactorProfile.Generated.cs b/src/Okta.Sdk/Generated/EmailFactorProfile.Generated.cs
new file mode 100644
index 000000000..07930f894
--- /dev/null
+++ b/src/Okta.Sdk/Generated/EmailFactorProfile.Generated.cs
@@ -0,0 +1,27 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Okta.Sdk.Internal;
+
+namespace Okta.Sdk
+{
+ ///
+ public sealed partial class EmailFactorProfile : FactorProfile, IEmailFactorProfile
+ {
+ ///
+ public string Email
+ {
+ get => GetStringProperty("email");
+ set => this["email"] = value;
+ }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/Factor.Generated.cs b/src/Okta.Sdk/Generated/Factor.Generated.cs
new file mode 100644
index 000000000..ab6585462
--- /dev/null
+++ b/src/Okta.Sdk/Generated/Factor.Generated.cs
@@ -0,0 +1,102 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Okta.Sdk.Internal;
+
+namespace Okta.Sdk
+{
+ ///
+ public partial class Factor : Resource, IFactor
+ {
+
+
+ ///
+ public string Device
+ {
+ get => GetStringProperty("device");
+ set => this["device"] = value;
+ }
+
+ ///
+ public string DeviceType => GetStringProperty("deviceType");
+
+ ///
+ public FactorType FactorType
+ {
+ get => GetEnumProperty("factorType");
+ set => this["factorType"] = value;
+ }
+
+ ///
+ public string Id => GetStringProperty("id");
+
+ ///
+ public string MfaStateTokenId
+ {
+ get => GetStringProperty("mfaStateTokenId");
+ set => this["mfaStateTokenId"] = value;
+ }
+
+ ///
+ public IFactorProfile Profile
+ {
+ get => GetResourceProperty("profile");
+ set => this["profile"] = value;
+ }
+
+ ///
+ public FactorProvider Provider
+ {
+ get => GetEnumProperty("provider");
+ set => this["provider"] = value;
+ }
+
+ ///
+ public bool? RechallengeExistingFactor
+ {
+ get => GetBooleanProperty("rechallengeExistingFactor");
+ set => this["rechallengeExistingFactor"] = value;
+ }
+
+ ///
+ public string SessionId
+ {
+ get => GetStringProperty("sessionId");
+ set => this["sessionId"] = value;
+ }
+
+ ///
+ public FactorStatus Status => GetEnumProperty("status");
+
+ ///
+ public string UserId
+ {
+ get => GetStringProperty("userId");
+ set => this["userId"] = value;
+ }
+
+ ///
+ public IVerifyFactorRequest Verify
+ {
+ get => GetResourceProperty("verify");
+ set => this["verify"] = value;
+ }
+
+
+ ///
+ public Task ActivateAsync(VerifyFactorRequest verifyFactorRequest, string userId, CancellationToken cancellationToken = default(CancellationToken))
+ => GetClient().UserFactors.ActivateFactorAsync(verifyFactorRequest, userId, Id, cancellationToken);
+
+ ///
+ public Task VerifyAsync(VerifyFactorRequest verifyFactorRequest, string userId, string templateId = null, CancellationToken cancellationToken = default(CancellationToken))
+ => GetClient().UserFactors.VerifyFactorAsync(verifyFactorRequest, userId, Id, templateId, cancellationToken);
+ }
+}
diff --git a/src/Okta.Sdk/Generated/FactorProfile.Generated.cs b/src/Okta.Sdk/Generated/FactorProfile.Generated.cs
new file mode 100644
index 000000000..31a681156
--- /dev/null
+++ b/src/Okta.Sdk/Generated/FactorProfile.Generated.cs
@@ -0,0 +1,20 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Okta.Sdk.Internal;
+
+namespace Okta.Sdk
+{
+ ///
+ public partial class FactorProfile : Resource, IFactorProfile
+ {
+ }
+}
diff --git a/src/Okta.Sdk/Generated/FactorProvider.Generated.cs b/src/Okta.Sdk/Generated/FactorProvider.Generated.cs
new file mode 100644
index 000000000..8b92a4dfd
--- /dev/null
+++ b/src/Okta.Sdk/Generated/FactorProvider.Generated.cs
@@ -0,0 +1,45 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+namespace Okta.Sdk
+{
+ ///
+ /// An enumeration of FactorProvider values in the Okta API.
+ ///
+ public sealed class FactorProvider : StringEnum
+ {
+ /// The OKTA FactorProvider.
+ public static FactorProvider Okta = new FactorProvider("OKTA");
+
+ /// The RSA FactorProvider.
+ public static FactorProvider Rsa = new FactorProvider("RSA");
+
+ /// The GOOGLE FactorProvider.
+ public static FactorProvider Google = new FactorProvider("GOOGLE");
+
+ /// The SYMANTEC FactorProvider.
+ public static FactorProvider Symantec = new FactorProvider("SYMANTEC");
+
+ /// The DUO FactorProvider.
+ public static FactorProvider Duo = new FactorProvider("DUO");
+
+ /// The YUBICO FactorProvider.
+ public static FactorProvider Yubico = new FactorProvider("YUBICO");
+
+ /// The FIDO FactorProvider.
+ public static FactorProvider Fido = new FactorProvider("FIDO");
+
+ ///
+ /// Creates a new instance.
+ ///
+ /// The value to use.
+ public FactorProvider(string value)
+ : base(value)
+ {
+ }
+ }
+}
diff --git a/src/Okta.Sdk/Generated/FactorResolver.Generated.cs b/src/Okta.Sdk/Generated/FactorResolver.Generated.cs
new file mode 100644
index 000000000..edf6b8127
--- /dev/null
+++ b/src/Okta.Sdk/Generated/FactorResolver.Generated.cs
@@ -0,0 +1,81 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Okta.Sdk.Internal
+{
+ ///
+ /// Resolves Factor resources based on the FactorType property.
+ ///
+ public class FactorResolver : AbstractResourceTypeResolver
+ {
+ ///
+ /// Gets the type of a Factor resource given its .
+ ///
+ /// The resource data.
+ /// The resource type.
+ public override Type GetResolvedType(IDictionary data)
+ {
+ var value = data
+ ?.Where(kv => kv.Key.Equals("factorType", StringComparison.OrdinalIgnoreCase))
+ ?.FirstOrDefault().Value?.ToString();
+
+ if (string.IsNullOrEmpty(value))
+ {
+ return typeof(Factor);
+ }
+
+ if (value.Equals("call"))
+ {
+ return typeof(CallFactor);
+ }
+
+ if (value.Equals("email"))
+ {
+ return typeof(EmailFactor);
+ }
+
+ if (value.Equals("push"))
+ {
+ return typeof(PushFactor);
+ }
+
+ if (value.Equals("question"))
+ {
+ return typeof(SecurityQuestionFactor);
+ }
+
+ if (value.Equals("sms"))
+ {
+ return typeof(SmsFactor);
+ }
+
+ if (value.Equals("token"))
+ {
+ return typeof(TokenFactor);
+ }
+
+ if (value.Equals("token:hardware"))
+ {
+ return typeof(HardwareFactor);
+ }
+
+ if (value.Equals("token:software:totp"))
+ {
+ return typeof(TotpFactor);
+ }
+
+ if (value.Equals("web"))
+ {
+ return typeof(WebFactor);
+ }
+
+ return typeof(Factor);
+ }
+ }
+}
diff --git a/src/Okta.Sdk/Generated/FactorResultType.Generated.cs b/src/Okta.Sdk/Generated/FactorResultType.Generated.cs
new file mode 100644
index 000000000..34270114f
--- /dev/null
+++ b/src/Okta.Sdk/Generated/FactorResultType.Generated.cs
@@ -0,0 +1,51 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+namespace Okta.Sdk
+{
+ ///
+ /// An enumeration of FactorResultType values in the Okta API.
+ ///
+ public sealed class FactorResultType : StringEnum
+ {
+ /// The SUCCESS FactorResultType.
+ public static FactorResultType Success = new FactorResultType("SUCCESS");
+
+ /// The CHALLENGE FactorResultType.
+ public static FactorResultType Challenge = new FactorResultType("CHALLENGE");
+
+ /// The WAITING FactorResultType.
+ public static FactorResultType Waiting = new FactorResultType("WAITING");
+
+ /// The FAILED FactorResultType.
+ public static FactorResultType Failed = new FactorResultType("FAILED");
+
+ /// The REJECTED FactorResultType.
+ public static FactorResultType Rejected = new FactorResultType("REJECTED");
+
+ /// The TIMEOUT FactorResultType.
+ public static FactorResultType Timeout = new FactorResultType("TIMEOUT");
+
+ /// The TIME_WINDOW_EXCEEDED FactorResultType.
+ public static FactorResultType TimeWindowExceeded = new FactorResultType("TIME_WINDOW_EXCEEDED");
+
+ /// The PASSCODE_REPLAYED FactorResultType.
+ public static FactorResultType PasscodeReplayed = new FactorResultType("PASSCODE_REPLAYED");
+
+ /// The ERROR FactorResultType.
+ public static FactorResultType Error = new FactorResultType("ERROR");
+
+ ///
+ /// Creates a new instance.
+ ///
+ /// The value to use.
+ public FactorResultType(string value)
+ : base(value)
+ {
+ }
+ }
+}
diff --git a/src/Okta.Sdk/Generated/FactorStatus.Generated.cs b/src/Okta.Sdk/Generated/FactorStatus.Generated.cs
new file mode 100644
index 000000000..96ad6c44b
--- /dev/null
+++ b/src/Okta.Sdk/Generated/FactorStatus.Generated.cs
@@ -0,0 +1,45 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+namespace Okta.Sdk
+{
+ ///
+ /// An enumeration of FactorStatus values in the Okta API.
+ ///
+ public sealed class FactorStatus : StringEnum
+ {
+ /// The PENDING_ACTIVATION FactorStatus.
+ public static FactorStatus PendingActivation = new FactorStatus("PENDING_ACTIVATION");
+
+ /// The ACTIVE FactorStatus.
+ public static FactorStatus Active = new FactorStatus("ACTIVE");
+
+ /// The INACTIVE FactorStatus.
+ public static FactorStatus Inactive = new FactorStatus("INACTIVE");
+
+ /// The NOT_SETUP FactorStatus.
+ public static FactorStatus NotSetup = new FactorStatus("NOT_SETUP");
+
+ /// The ENROLLED FactorStatus.
+ public static FactorStatus Enrolled = new FactorStatus("ENROLLED");
+
+ /// The DISABLED FactorStatus.
+ public static FactorStatus Disabled = new FactorStatus("DISABLED");
+
+ /// The EXPIRED FactorStatus.
+ public static FactorStatus Expired = new FactorStatus("EXPIRED");
+
+ ///
+ /// Creates a new instance.
+ ///
+ /// The value to use.
+ public FactorStatus(string value)
+ : base(value)
+ {
+ }
+ }
+}
diff --git a/src/Okta.Sdk/Generated/FactorType.Generated.cs b/src/Okta.Sdk/Generated/FactorType.Generated.cs
new file mode 100644
index 000000000..38f092d83
--- /dev/null
+++ b/src/Okta.Sdk/Generated/FactorType.Generated.cs
@@ -0,0 +1,51 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+namespace Okta.Sdk
+{
+ ///
+ /// An enumeration of FactorType values in the Okta API.
+ ///
+ public sealed class FactorType : StringEnum
+ {
+ /// The push FactorType.
+ public static FactorType Push = new FactorType("push");
+
+ /// The sms FactorType.
+ public static FactorType Sms = new FactorType("sms");
+
+ /// The call FactorType.
+ public static FactorType Call = new FactorType("call");
+
+ /// The token FactorType.
+ public static FactorType Token = new FactorType("token");
+
+ /// The token:software:totp FactorType.
+ public static FactorType TokenSoftwareTotp = new FactorType("token:software:totp");
+
+ /// The token:hardware FactorType.
+ public static FactorType TokenHardware = new FactorType("token:hardware");
+
+ /// The question FactorType.
+ public static FactorType Question = new FactorType("question");
+
+ /// The web FactorType.
+ public static FactorType Web = new FactorType("web");
+
+ /// The email FactorType.
+ public static FactorType Email = new FactorType("email");
+
+ ///
+ /// Creates a new instance.
+ ///
+ /// The value to use.
+ public FactorType(string value)
+ : base(value)
+ {
+ }
+ }
+}
diff --git a/src/Okta.Sdk/Generated/ForgotPasswordResponse.Generated.cs b/src/Okta.Sdk/Generated/ForgotPasswordResponse.Generated.cs
index f28272cf9..696a02df8 100644
--- a/src/Okta.Sdk/Generated/ForgotPasswordResponse.Generated.cs
+++ b/src/Okta.Sdk/Generated/ForgotPasswordResponse.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/Group.Generated.cs b/src/Okta.Sdk/Generated/Group.Generated.cs
index 9734add55..02b2fe803 100644
--- a/src/Okta.Sdk/Generated/Group.Generated.cs
+++ b/src/Okta.Sdk/Generated/Group.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/GroupProfile.Generated.cs b/src/Okta.Sdk/Generated/GroupProfile.Generated.cs
index e2cef407d..880fcdc22 100644
--- a/src/Okta.Sdk/Generated/GroupProfile.Generated.cs
+++ b/src/Okta.Sdk/Generated/GroupProfile.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/GroupRule.Generated.cs b/src/Okta.Sdk/Generated/GroupRule.Generated.cs
index d1e137c28..0c0d8f029 100644
--- a/src/Okta.Sdk/Generated/GroupRule.Generated.cs
+++ b/src/Okta.Sdk/Generated/GroupRule.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/GroupRuleAction.Generated.cs b/src/Okta.Sdk/Generated/GroupRuleAction.Generated.cs
index 3a2d15e06..03468d0c9 100644
--- a/src/Okta.Sdk/Generated/GroupRuleAction.Generated.cs
+++ b/src/Okta.Sdk/Generated/GroupRuleAction.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/GroupRuleConditions.Generated.cs b/src/Okta.Sdk/Generated/GroupRuleConditions.Generated.cs
index 47f930da0..0fbe9dea0 100644
--- a/src/Okta.Sdk/Generated/GroupRuleConditions.Generated.cs
+++ b/src/Okta.Sdk/Generated/GroupRuleConditions.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/GroupRuleExpression.Generated.cs b/src/Okta.Sdk/Generated/GroupRuleExpression.Generated.cs
index 21a0fd0e6..0418ead54 100644
--- a/src/Okta.Sdk/Generated/GroupRuleExpression.Generated.cs
+++ b/src/Okta.Sdk/Generated/GroupRuleExpression.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/GroupRuleGroupAssignment.Generated.cs b/src/Okta.Sdk/Generated/GroupRuleGroupAssignment.Generated.cs
index 6009f8351..3cd08d031 100644
--- a/src/Okta.Sdk/Generated/GroupRuleGroupAssignment.Generated.cs
+++ b/src/Okta.Sdk/Generated/GroupRuleGroupAssignment.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/GroupRuleGroupCondition.Generated.cs b/src/Okta.Sdk/Generated/GroupRuleGroupCondition.Generated.cs
index 391be66d6..8c2b85df5 100644
--- a/src/Okta.Sdk/Generated/GroupRuleGroupCondition.Generated.cs
+++ b/src/Okta.Sdk/Generated/GroupRuleGroupCondition.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/GroupRulePeopleCondition.Generated.cs b/src/Okta.Sdk/Generated/GroupRulePeopleCondition.Generated.cs
index 97073aceb..5c6caa6c7 100644
--- a/src/Okta.Sdk/Generated/GroupRulePeopleCondition.Generated.cs
+++ b/src/Okta.Sdk/Generated/GroupRulePeopleCondition.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/GroupRuleStatus.Generated.cs b/src/Okta.Sdk/Generated/GroupRuleStatus.Generated.cs
index 1495bb30d..ac3e9883c 100644
--- a/src/Okta.Sdk/Generated/GroupRuleStatus.Generated.cs
+++ b/src/Okta.Sdk/Generated/GroupRuleStatus.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
namespace Okta.Sdk
{
diff --git a/src/Okta.Sdk/Generated/GroupRuleUserCondition.Generated.cs b/src/Okta.Sdk/Generated/GroupRuleUserCondition.Generated.cs
index 7efef60b1..ef42ced77 100644
--- a/src/Okta.Sdk/Generated/GroupRuleUserCondition.Generated.cs
+++ b/src/Okta.Sdk/Generated/GroupRuleUserCondition.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/GroupsClient.Generated.cs b/src/Okta.Sdk/Generated/GroupsClient.Generated.cs
index 097dccc9f..59c648414 100644
--- a/src/Okta.Sdk/Generated/GroupsClient.Generated.cs
+++ b/src/Okta.Sdk/Generated/GroupsClient.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/HardwareFactor.Generated.cs b/src/Okta.Sdk/Generated/HardwareFactor.Generated.cs
new file mode 100644
index 000000000..5d23dff30
--- /dev/null
+++ b/src/Okta.Sdk/Generated/HardwareFactor.Generated.cs
@@ -0,0 +1,27 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Okta.Sdk.Internal;
+
+namespace Okta.Sdk
+{
+ ///
+ public sealed partial class HardwareFactor : Factor, IHardwareFactor
+ {
+ ///
+ public new IHardwareFactorProfile Profile
+ {
+ get => GetResourceProperty("profile");
+ set => this["profile"] = value;
+ }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/HardwareFactorProfile.Generated.cs b/src/Okta.Sdk/Generated/HardwareFactorProfile.Generated.cs
new file mode 100644
index 000000000..a94250372
--- /dev/null
+++ b/src/Okta.Sdk/Generated/HardwareFactorProfile.Generated.cs
@@ -0,0 +1,27 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Okta.Sdk.Internal;
+
+namespace Okta.Sdk
+{
+ ///
+ public sealed partial class HardwareFactorProfile : FactorProfile, IHardwareFactorProfile
+ {
+ ///
+ public string CredentialId
+ {
+ get => GetStringProperty("credentialId");
+ set => this["credentialId"] = value;
+ }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/IAppLink.Generated.cs b/src/Okta.Sdk/Generated/IAppLink.Generated.cs
index 51dc36826..3a346bcf3 100644
--- a/src/Okta.Sdk/Generated/IAppLink.Generated.cs
+++ b/src/Okta.Sdk/Generated/IAppLink.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/IAuthenticationProvider.Generated.cs b/src/Okta.Sdk/Generated/IAuthenticationProvider.Generated.cs
index 7c19edd21..5d25ae0fe 100644
--- a/src/Okta.Sdk/Generated/IAuthenticationProvider.Generated.cs
+++ b/src/Okta.Sdk/Generated/IAuthenticationProvider.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/ICallFactor.Generated.cs b/src/Okta.Sdk/Generated/ICallFactor.Generated.cs
new file mode 100644
index 000000000..d6e46cd24
--- /dev/null
+++ b/src/Okta.Sdk/Generated/ICallFactor.Generated.cs
@@ -0,0 +1,21 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// Represents a CallFactor resource in the Okta API.
+ public partial interface ICallFactor : IFactor
+ {
+ new ICallFactorProfile Profile { get; set; }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/ICallFactorProfile.Generated.cs b/src/Okta.Sdk/Generated/ICallFactorProfile.Generated.cs
new file mode 100644
index 000000000..80a235499
--- /dev/null
+++ b/src/Okta.Sdk/Generated/ICallFactorProfile.Generated.cs
@@ -0,0 +1,23 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// Represents a CallFactorProfile resource in the Okta API.
+ public partial interface ICallFactorProfile : IFactorProfile
+ {
+ string PhoneExtension { get; set; }
+
+ string PhoneNumber { get; set; }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/IChangePasswordRequest.Generated.cs b/src/Okta.Sdk/Generated/IChangePasswordRequest.Generated.cs
index 39741d316..ee3245005 100644
--- a/src/Okta.Sdk/Generated/IChangePasswordRequest.Generated.cs
+++ b/src/Okta.Sdk/Generated/IChangePasswordRequest.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/IEmailFactor.Generated.cs b/src/Okta.Sdk/Generated/IEmailFactor.Generated.cs
new file mode 100644
index 000000000..598754932
--- /dev/null
+++ b/src/Okta.Sdk/Generated/IEmailFactor.Generated.cs
@@ -0,0 +1,21 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// Represents a EmailFactor resource in the Okta API.
+ public partial interface IEmailFactor : IFactor
+ {
+ new IEmailFactorProfile Profile { get; set; }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/IEmailFactorProfile.Generated.cs b/src/Okta.Sdk/Generated/IEmailFactorProfile.Generated.cs
new file mode 100644
index 000000000..9c0dab5f3
--- /dev/null
+++ b/src/Okta.Sdk/Generated/IEmailFactorProfile.Generated.cs
@@ -0,0 +1,21 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// Represents a EmailFactorProfile resource in the Okta API.
+ public partial interface IEmailFactorProfile : IFactorProfile
+ {
+ string Email { get; set; }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/IFactor.Generated.cs b/src/Okta.Sdk/Generated/IFactor.Generated.cs
new file mode 100644
index 000000000..089c7c7d4
--- /dev/null
+++ b/src/Okta.Sdk/Generated/IFactor.Generated.cs
@@ -0,0 +1,49 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// Represents a Factor resource in the Okta API.
+ public partial interface IFactor : IResource
+ {
+
+
+ string Device { get; set; }
+
+ string DeviceType { get; }
+
+ FactorType FactorType { get; set; }
+
+ string Id { get; }
+
+ string MfaStateTokenId { get; set; }
+
+ IFactorProfile Profile { get; set; }
+
+ FactorProvider Provider { get; set; }
+
+ bool? RechallengeExistingFactor { get; set; }
+
+ string SessionId { get; set; }
+
+ FactorStatus Status { get; }
+
+ string UserId { get; set; }
+
+ IVerifyFactorRequest Verify { get; set; }
+
+ Task ActivateAsync(VerifyFactorRequest verifyFactorRequest, string userId, CancellationToken cancellationToken = default(CancellationToken));
+
+ Task VerifyAsync(VerifyFactorRequest verifyFactorRequest, string userId, string templateId = null, CancellationToken cancellationToken = default(CancellationToken));
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/IFactorProfile.Generated.cs b/src/Okta.Sdk/Generated/IFactorProfile.Generated.cs
new file mode 100644
index 000000000..e24fa45ea
--- /dev/null
+++ b/src/Okta.Sdk/Generated/IFactorProfile.Generated.cs
@@ -0,0 +1,19 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// Represents a FactorProfile resource in the Okta API.
+ public partial interface IFactorProfile : IResource
+ {
+ }
+}
diff --git a/src/Okta.Sdk/Generated/IForgotPasswordResponse.Generated.cs b/src/Okta.Sdk/Generated/IForgotPasswordResponse.Generated.cs
index a5c6a8af0..a0fc6a952 100644
--- a/src/Okta.Sdk/Generated/IForgotPasswordResponse.Generated.cs
+++ b/src/Okta.Sdk/Generated/IForgotPasswordResponse.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/IGroup.Generated.cs b/src/Okta.Sdk/Generated/IGroup.Generated.cs
index bc518b1ac..1e4af2768 100644
--- a/src/Okta.Sdk/Generated/IGroup.Generated.cs
+++ b/src/Okta.Sdk/Generated/IGroup.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/IGroupProfile.Generated.cs b/src/Okta.Sdk/Generated/IGroupProfile.Generated.cs
index 583e754c9..70b1a83c3 100644
--- a/src/Okta.Sdk/Generated/IGroupProfile.Generated.cs
+++ b/src/Okta.Sdk/Generated/IGroupProfile.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/IGroupRule.Generated.cs b/src/Okta.Sdk/Generated/IGroupRule.Generated.cs
index bb761c4f6..97a034513 100644
--- a/src/Okta.Sdk/Generated/IGroupRule.Generated.cs
+++ b/src/Okta.Sdk/Generated/IGroupRule.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/IGroupRuleAction.Generated.cs b/src/Okta.Sdk/Generated/IGroupRuleAction.Generated.cs
index bb1011ca1..abf53699b 100644
--- a/src/Okta.Sdk/Generated/IGroupRuleAction.Generated.cs
+++ b/src/Okta.Sdk/Generated/IGroupRuleAction.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/IGroupRuleConditions.Generated.cs b/src/Okta.Sdk/Generated/IGroupRuleConditions.Generated.cs
index 14f6ff1be..f4c1da6aa 100644
--- a/src/Okta.Sdk/Generated/IGroupRuleConditions.Generated.cs
+++ b/src/Okta.Sdk/Generated/IGroupRuleConditions.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/IGroupRuleExpression.Generated.cs b/src/Okta.Sdk/Generated/IGroupRuleExpression.Generated.cs
index 195fa77a8..f31dc01ce 100644
--- a/src/Okta.Sdk/Generated/IGroupRuleExpression.Generated.cs
+++ b/src/Okta.Sdk/Generated/IGroupRuleExpression.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/IGroupRuleGroupAssignment.Generated.cs b/src/Okta.Sdk/Generated/IGroupRuleGroupAssignment.Generated.cs
index eccbe27fc..ee17dd966 100644
--- a/src/Okta.Sdk/Generated/IGroupRuleGroupAssignment.Generated.cs
+++ b/src/Okta.Sdk/Generated/IGroupRuleGroupAssignment.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/IGroupRuleGroupCondition.Generated.cs b/src/Okta.Sdk/Generated/IGroupRuleGroupCondition.Generated.cs
index f6dab22e4..cabdcf65b 100644
--- a/src/Okta.Sdk/Generated/IGroupRuleGroupCondition.Generated.cs
+++ b/src/Okta.Sdk/Generated/IGroupRuleGroupCondition.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/IGroupRulePeopleCondition.Generated.cs b/src/Okta.Sdk/Generated/IGroupRulePeopleCondition.Generated.cs
index e4c434437..32f48df0a 100644
--- a/src/Okta.Sdk/Generated/IGroupRulePeopleCondition.Generated.cs
+++ b/src/Okta.Sdk/Generated/IGroupRulePeopleCondition.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/IGroupRuleUserCondition.Generated.cs b/src/Okta.Sdk/Generated/IGroupRuleUserCondition.Generated.cs
index 0dd306495..24feeef8a 100644
--- a/src/Okta.Sdk/Generated/IGroupRuleUserCondition.Generated.cs
+++ b/src/Okta.Sdk/Generated/IGroupRuleUserCondition.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/IGroupsClient.Generated.cs b/src/Okta.Sdk/Generated/IGroupsClient.Generated.cs
index 161adf5e7..6cf020d60 100644
--- a/src/Okta.Sdk/Generated/IGroupsClient.Generated.cs
+++ b/src/Okta.Sdk/Generated/IGroupsClient.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System.Collections.Generic;
using System.Threading;
@@ -12,7 +11,7 @@
namespace Okta.Sdk
{
- /// A client that works with resources.
+ /// A client that works with Okta Group resources.
public partial interface IGroupsClient
{
///
@@ -51,7 +50,7 @@ public partial interface IGroupsClient
Task CreateRuleAsync(IGroupRule groupRule, CancellationToken cancellationToken = default(CancellationToken));
///
- ///
+ /// Removes a specific group rule by id from your organization
///
///
///
@@ -60,7 +59,7 @@ public partial interface IGroupsClient
Task DeleteRuleAsync(string ruleId, bool? removeUsers = null, CancellationToken cancellationToken = default(CancellationToken));
///
- ///
+ /// Fetches a specific group rule by id from your organization
///
///
/// The cancellation token.
@@ -77,7 +76,7 @@ public partial interface IGroupsClient
Task UpdateRuleAsync(IGroupRule groupRule, string ruleId, CancellationToken cancellationToken = default(CancellationToken));
///
- ///
+ /// Activates a specific group rule by id from your organization
///
///
/// The cancellation token.
@@ -85,7 +84,7 @@ public partial interface IGroupsClient
Task ActivateRuleAsync(string ruleId, CancellationToken cancellationToken = default(CancellationToken));
///
- ///
+ /// Deactivates a specific group rule by id from your organization
///
///
/// The cancellation token.
@@ -93,7 +92,7 @@ public partial interface IGroupsClient
Task DeactivateRuleAsync(string ruleId, CancellationToken cancellationToken = default(CancellationToken));
///
- ///
+ /// Removes a group with `OKTA_GROUP` type from your organization.
///
///
/// The cancellation token.
@@ -101,7 +100,7 @@ public partial interface IGroupsClient
Task DeleteGroupAsync(string groupId, CancellationToken cancellationToken = default(CancellationToken));
///
- ///
+ /// Lists all group rules for your organization.
///
///
///
@@ -110,7 +109,7 @@ public partial interface IGroupsClient
Task GetGroupAsync(string groupId, string expand = null, CancellationToken cancellationToken = default(CancellationToken));
///
- ///
+ /// Updates the profile for a group with `OKTA_GROUP` type from your organization.
///
/// The resource.
///
@@ -119,16 +118,16 @@ public partial interface IGroupsClient
Task UpdateGroupAsync(IGroup group, string groupId, CancellationToken cancellationToken = default(CancellationToken));
///
- ///
+ /// Enumerates all [users](/docs/api/resources/users.html#user-model) that are a member of a group.
///
///
- ///
- ///
+ /// Specifies the pagination cursor for the next page of users
+ /// Specifies the number of user results in a page
/// A collection of that can be enumerated asynchronously.
IAsyncEnumerable ListGroupUsers(string groupId, string after = null, int? limit = -1);
///
- ///
+ /// Removes a [user](users.html#user-model) from a group with `OKTA_GROUP` type.
///
///
///
@@ -137,7 +136,7 @@ public partial interface IGroupsClient
Task RemoveGroupUserAsync(string groupId, string userId, CancellationToken cancellationToken = default(CancellationToken));
///
- ///
+ /// Adds a [user](users.html#user-model) to a group with `OKTA_GROUP` type.
///
///
///
diff --git a/src/Okta.Sdk/Generated/IHardwareFactor.Generated.cs b/src/Okta.Sdk/Generated/IHardwareFactor.Generated.cs
new file mode 100644
index 000000000..3086465b8
--- /dev/null
+++ b/src/Okta.Sdk/Generated/IHardwareFactor.Generated.cs
@@ -0,0 +1,21 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// Represents a HardwareFactor resource in the Okta API.
+ public partial interface IHardwareFactor : IFactor
+ {
+ new IHardwareFactorProfile Profile { get; set; }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/IHardwareFactorProfile.Generated.cs b/src/Okta.Sdk/Generated/IHardwareFactorProfile.Generated.cs
new file mode 100644
index 000000000..a8a7a19f9
--- /dev/null
+++ b/src/Okta.Sdk/Generated/IHardwareFactorProfile.Generated.cs
@@ -0,0 +1,21 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// Represents a HardwareFactorProfile resource in the Okta API.
+ public partial interface IHardwareFactorProfile : IFactorProfile
+ {
+ string CredentialId { get; set; }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/IPasswordCredential.Generated.cs b/src/Okta.Sdk/Generated/IPasswordCredential.Generated.cs
index 0b1cd45c8..1faed803f 100644
--- a/src/Okta.Sdk/Generated/IPasswordCredential.Generated.cs
+++ b/src/Okta.Sdk/Generated/IPasswordCredential.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/IPushFactor.Generated.cs b/src/Okta.Sdk/Generated/IPushFactor.Generated.cs
new file mode 100644
index 000000000..0604b58a1
--- /dev/null
+++ b/src/Okta.Sdk/Generated/IPushFactor.Generated.cs
@@ -0,0 +1,21 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// Represents a PushFactor resource in the Okta API.
+ public partial interface IPushFactor : IFactor
+ {
+ new IPushFactorProfile Profile { get; set; }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/IPushFactorProfile.Generated.cs b/src/Okta.Sdk/Generated/IPushFactorProfile.Generated.cs
new file mode 100644
index 000000000..d5549a3d0
--- /dev/null
+++ b/src/Okta.Sdk/Generated/IPushFactorProfile.Generated.cs
@@ -0,0 +1,29 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// Represents a PushFactorProfile resource in the Okta API.
+ public partial interface IPushFactorProfile : IFactorProfile
+ {
+ string CredentialId { get; set; }
+
+ string DeviceType { get; }
+
+ string Name { get; set; }
+
+ string Platform { get; }
+
+ string Version { get; set; }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/IRecoveryQuestionCredential.Generated.cs b/src/Okta.Sdk/Generated/IRecoveryQuestionCredential.Generated.cs
index 2a4a3b46e..957105f68 100644
--- a/src/Okta.Sdk/Generated/IRecoveryQuestionCredential.Generated.cs
+++ b/src/Okta.Sdk/Generated/IRecoveryQuestionCredential.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/IResetPasswordToken.Generated.cs b/src/Okta.Sdk/Generated/IResetPasswordToken.Generated.cs
index 1feba2b4d..3c4908733 100644
--- a/src/Okta.Sdk/Generated/IResetPasswordToken.Generated.cs
+++ b/src/Okta.Sdk/Generated/IResetPasswordToken.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/IRole.Generated.cs b/src/Okta.Sdk/Generated/IRole.Generated.cs
index 0d78a6cd5..5c9c110e4 100644
--- a/src/Okta.Sdk/Generated/IRole.Generated.cs
+++ b/src/Okta.Sdk/Generated/IRole.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/ISecurityQuestion.Generated.cs b/src/Okta.Sdk/Generated/ISecurityQuestion.Generated.cs
new file mode 100644
index 000000000..3f403c312
--- /dev/null
+++ b/src/Okta.Sdk/Generated/ISecurityQuestion.Generated.cs
@@ -0,0 +1,25 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// Represents a SecurityQuestion resource in the Okta API.
+ public partial interface ISecurityQuestion : IResource
+ {
+ string Answer { get; set; }
+
+ string Question { get; set; }
+
+ string QuestionText { get; set; }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/ISecurityQuestionFactor.Generated.cs b/src/Okta.Sdk/Generated/ISecurityQuestionFactor.Generated.cs
new file mode 100644
index 000000000..9c8ef2143
--- /dev/null
+++ b/src/Okta.Sdk/Generated/ISecurityQuestionFactor.Generated.cs
@@ -0,0 +1,21 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// Represents a SecurityQuestionFactor resource in the Okta API.
+ public partial interface ISecurityQuestionFactor : IFactor
+ {
+ new ISecurityQuestionFactorProfile Profile { get; set; }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/ISecurityQuestionFactorProfile.Generated.cs b/src/Okta.Sdk/Generated/ISecurityQuestionFactorProfile.Generated.cs
new file mode 100644
index 000000000..6945e56fc
--- /dev/null
+++ b/src/Okta.Sdk/Generated/ISecurityQuestionFactorProfile.Generated.cs
@@ -0,0 +1,25 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// Represents a SecurityQuestionFactorProfile resource in the Okta API.
+ public partial interface ISecurityQuestionFactorProfile : IFactorProfile
+ {
+ string Answer { get; set; }
+
+ string Question { get; set; }
+
+ string QuestionText { get; set; }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/ISmsFactor.Generated.cs b/src/Okta.Sdk/Generated/ISmsFactor.Generated.cs
new file mode 100644
index 000000000..a62231ca6
--- /dev/null
+++ b/src/Okta.Sdk/Generated/ISmsFactor.Generated.cs
@@ -0,0 +1,21 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// Represents a SmsFactor resource in the Okta API.
+ public partial interface ISmsFactor : IFactor
+ {
+ new ISmsFactorProfile Profile { get; set; }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/ISmsFactorProfile.Generated.cs b/src/Okta.Sdk/Generated/ISmsFactorProfile.Generated.cs
new file mode 100644
index 000000000..22bbe1af8
--- /dev/null
+++ b/src/Okta.Sdk/Generated/ISmsFactorProfile.Generated.cs
@@ -0,0 +1,21 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// Represents a SmsFactorProfile resource in the Okta API.
+ public partial interface ISmsFactorProfile : IFactorProfile
+ {
+ string PhoneNumber { get; set; }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/ITempPassword.Generated.cs b/src/Okta.Sdk/Generated/ITempPassword.Generated.cs
index ab87c662a..a956952ae 100644
--- a/src/Okta.Sdk/Generated/ITempPassword.Generated.cs
+++ b/src/Okta.Sdk/Generated/ITempPassword.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/ITokenFactor.Generated.cs b/src/Okta.Sdk/Generated/ITokenFactor.Generated.cs
new file mode 100644
index 000000000..5e530800e
--- /dev/null
+++ b/src/Okta.Sdk/Generated/ITokenFactor.Generated.cs
@@ -0,0 +1,21 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// Represents a TokenFactor resource in the Okta API.
+ public partial interface ITokenFactor : IFactor
+ {
+ new ITokenFactorProfile Profile { get; set; }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/ITokenFactorProfile.Generated.cs b/src/Okta.Sdk/Generated/ITokenFactorProfile.Generated.cs
new file mode 100644
index 000000000..a1f51f0b2
--- /dev/null
+++ b/src/Okta.Sdk/Generated/ITokenFactorProfile.Generated.cs
@@ -0,0 +1,21 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// Represents a TokenFactorProfile resource in the Okta API.
+ public partial interface ITokenFactorProfile : IFactorProfile
+ {
+ string CredentialId { get; set; }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/ITotpFactor.Generated.cs b/src/Okta.Sdk/Generated/ITotpFactor.Generated.cs
new file mode 100644
index 000000000..2b6ad0f66
--- /dev/null
+++ b/src/Okta.Sdk/Generated/ITotpFactor.Generated.cs
@@ -0,0 +1,21 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// Represents a TotpFactor resource in the Okta API.
+ public partial interface ITotpFactor : IFactor
+ {
+ new ITotpFactorProfile Profile { get; set; }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/ITotpFactorProfile.Generated.cs b/src/Okta.Sdk/Generated/ITotpFactorProfile.Generated.cs
new file mode 100644
index 000000000..7773c42ca
--- /dev/null
+++ b/src/Okta.Sdk/Generated/ITotpFactorProfile.Generated.cs
@@ -0,0 +1,21 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// Represents a TotpFactorProfile resource in the Okta API.
+ public partial interface ITotpFactorProfile : IFactorProfile
+ {
+ string CredentialId { get; set; }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/IUser.Generated.cs b/src/Okta.Sdk/Generated/IUser.Generated.cs
index 17ffabf91..e1d9b8c22 100644
--- a/src/Okta.Sdk/Generated/IUser.Generated.cs
+++ b/src/Okta.Sdk/Generated/IUser.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
@@ -56,5 +55,15 @@ public partial interface IUser : IResource
Task AddToGroupAsync(string groupId, CancellationToken cancellationToken = default(CancellationToken));
+ Task AddFactorAsync(Factor factor, bool? updatePhone = false, string templateId = null, CancellationToken cancellationToken = default(CancellationToken));
+
+ IAsyncEnumerable ListSupportedFactors();
+
+ IAsyncEnumerable ListFactors();
+
+ IAsyncEnumerable ListSupportedSecurityQuestions();
+
+ Task GetFactorAsync(string factorId, CancellationToken cancellationToken = default(CancellationToken));
+
}
}
diff --git a/src/Okta.Sdk/Generated/IUserActivationToken.Generated.cs b/src/Okta.Sdk/Generated/IUserActivationToken.Generated.cs
index 42aa5988b..7711f95af 100644
--- a/src/Okta.Sdk/Generated/IUserActivationToken.Generated.cs
+++ b/src/Okta.Sdk/Generated/IUserActivationToken.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/IUserCredentials.Generated.cs b/src/Okta.Sdk/Generated/IUserCredentials.Generated.cs
index feb950c09..485d5e2e2 100644
--- a/src/Okta.Sdk/Generated/IUserCredentials.Generated.cs
+++ b/src/Okta.Sdk/Generated/IUserCredentials.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/IUserFactorsClient.Generated.cs b/src/Okta.Sdk/Generated/IUserFactorsClient.Generated.cs
new file mode 100644
index 000000000..b6304ee93
--- /dev/null
+++ b/src/Okta.Sdk/Generated/IUserFactorsClient.Generated.cs
@@ -0,0 +1,88 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// A client that works with Okta UserFactor resources.
+ public partial interface IUserFactorsClient
+ {
+ ///
+ /// Enumerates all the enrolled factors for the specified user
+ ///
+ ///
+ /// A collection of that can be enumerated asynchronously.
+ IAsyncEnumerable ListFactors(string userId);
+
+ ///
+ /// Enrolls a user with a supported [factor](#list-factors-to-enroll)
+ ///
+ /// The resource.
+ ///
+ ///
+ /// id of SMS template (only for SMS factor)
+ /// The cancellation token.
+ /// The response.
+ Task AddFactorAsync(IFactor factor, string userId, bool? updatePhone = false, string templateId = null, CancellationToken cancellationToken = default(CancellationToken));
+
+ ///
+ /// Enumerates all the [supported factors](#supported-factors-for-providers) that can be enrolled for the specified user
+ ///
+ ///
+ /// A collection of that can be enumerated asynchronously.
+ IAsyncEnumerable ListSupportedFactors(string userId);
+
+ ///
+ /// Enumerates all available security questions for a user's `question` factor
+ ///
+ ///
+ /// A collection of that can be enumerated asynchronously.
+ IAsyncEnumerable ListSupportedSecurityQuestions(string userId);
+
+ ///
+ /// Unenrolls an existing factor for the specified user, allowing the user to enroll a new factor.
+ ///
+ ///
+ ///
+ /// The cancellation token.
+ /// A Task that represents the asynchronous operation.
+ Task DeleteFactorAsync(string userId, string factorId, CancellationToken cancellationToken = default(CancellationToken));
+
+ ///
+ /// Fetches a factor for the specified user
+ ///
+ ///
+ ///
+ /// The cancellation token.
+ /// The response.
+ Task GetFactorAsync(string userId, string factorId, CancellationToken cancellationToken = default(CancellationToken));
+
+ ///
+ /// The `sms` and `token:software:totp` [factor types](#factor-type) require activation to complete the enrollment process.
+ ///
+ /// The resource.
+ ///
+ ///
+ /// The cancellation token.
+ /// The response.
+ Task ActivateFactorAsync(IVerifyFactorRequest verifyFactorRequest, string userId, string factorId, CancellationToken cancellationToken = default(CancellationToken));
+
+ ///
+ /// Verifies an OTP for a `token` or `token:hardware` factor
+ ///
+ /// The resource.
+ ///
+ ///
+ ///
+ /// The cancellation token.
+ /// The response.
+ Task VerifyFactorAsync(IVerifyFactorRequest verifyFactorRequest, string userId, string factorId, string templateId = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/src/Okta.Sdk/Generated/IUserProfile.Generated.cs b/src/Okta.Sdk/Generated/IUserProfile.Generated.cs
index 39fe583e5..a2a2c2444 100644
--- a/src/Okta.Sdk/Generated/IUserProfile.Generated.cs
+++ b/src/Okta.Sdk/Generated/IUserProfile.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/IUsersClient.Generated.cs b/src/Okta.Sdk/Generated/IUsersClient.Generated.cs
index 5bea48c64..5200e0035 100644
--- a/src/Okta.Sdk/Generated/IUsersClient.Generated.cs
+++ b/src/Okta.Sdk/Generated/IUsersClient.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System.Collections.Generic;
using System.Threading;
@@ -12,7 +11,7 @@
namespace Okta.Sdk
{
- /// A client that works with resources.
+ /// A client that works with Okta User resources.
public partial interface IUsersClient
{
///
@@ -39,7 +38,7 @@ public partial interface IUsersClient
Task CreateUserAsync(IUser user, bool? activate = true, bool? provider = false, CancellationToken cancellationToken = default(CancellationToken));
///
- ///
+ /// Deletes a user permanently. This operation can only be performed on users that have a `DEPROVISIONED` status. **This action cannot be recovered!**
///
///
/// The cancellation token.
@@ -47,7 +46,7 @@ public partial interface IUsersClient
Task DeactivateOrDeleteUserAsync(string userId, CancellationToken cancellationToken = default(CancellationToken));
///
- ///
+ /// Fetches a user from your Okta organization.
///
///
/// The cancellation token.
@@ -55,7 +54,7 @@ public partial interface IUsersClient
Task GetUserAsync(string userId, CancellationToken cancellationToken = default(CancellationToken));
///
- ///
+ /// Update a user's profile and/or credentials using strict-update semantics.
///
/// The resource.
///
@@ -64,7 +63,7 @@ public partial interface IUsersClient
Task UpdateUserAsync(IUser user, string userId, CancellationToken cancellationToken = default(CancellationToken));
///
- ///
+ /// Fetches appLinks for all direct or indirect (via group membership) assigned applications.
///
///
///
@@ -72,7 +71,7 @@ public partial interface IUsersClient
IAsyncEnumerable ListAppLinks(string userId, bool? showAll = false);
///
- ///
+ /// Changes a user's password by validating the user's current password. This operation can only be performed on users in `STAGED`, `ACTIVE`, `PASSWORD_EXPIRED`, or `RECOVERY` status that have a valid [password credential](#password-object)
///
/// The resource.
///
@@ -81,7 +80,7 @@ public partial interface IUsersClient
Task ChangePasswordAsync(IChangePasswordRequest changePasswordRequest, string userId, CancellationToken cancellationToken = default(CancellationToken));
///
- ///
+ /// Changes a user's recovery question & answer credential by validating the user's current password. This operation can only be performed on users in **STAGED**, **ACTIVE** or **RECOVERY** `status` that have a valid [password credential](#password-object)
///
/// The resource.
///
@@ -90,7 +89,7 @@ public partial interface IUsersClient
Task ChangeRecoveryQuestionAsync(IUserCredentials userCredentials, string userId, CancellationToken cancellationToken = default(CancellationToken));
///
- ///
+ /// Fetches the groups of which the user is a member.
///
///
///
@@ -99,16 +98,16 @@ public partial interface IUsersClient
IAsyncEnumerable ListUserGroups(string userId, string after = null, int? limit = -1);
///
- ///
+ /// Activates a user. This operation can only be performed on users with a `STAGED` status. Activation of a user is an asynchronous operation. The user will have the `transitioningToStatus` property with a value of `ACTIVE` during activation to indicate that the user hasn't completed the asynchronous operation. The user will have a status of `ACTIVE` when the activation process is complete.
///
///
- ///
+ /// Sends an activation email to the user if true
/// The cancellation token.
/// The response.
Task ActivateUserAsync(string userId, bool? sendEmail = true, CancellationToken cancellationToken = default(CancellationToken));
///
- ///
+ /// Deactivates a user. This operation can only be performed on users that do not have a `DEPROVISIONED` status. Deactivation of a user is an asynchronous operation. The user will have the `transitioningToStatus` property with a value of `DEPROVISIONED` during deactivation to indicate that the user hasn't completed the asynchronous operation. The user will have a status of `DEPROVISIONED` when the deactivation process is complete.
///
///
/// The cancellation token.
@@ -116,16 +115,16 @@ public partial interface IUsersClient
Task DeactivateUserAsync(string userId, CancellationToken cancellationToken = default(CancellationToken));
///
- ///
+ /// This operation transitions the user to the status of `PASSWORD_EXPIRED` so that the user is required to change their password at their next login.
///
///
- ///
+ /// Sets the user's password to a temporary password, if true
/// The cancellation token.
/// The response.
Task ExpirePasswordAsync(string userId, bool? tempPassword = false, CancellationToken cancellationToken = default(CancellationToken));
///
- ///
+ /// This operation resets all factors for the specified user. All MFA factor enrollments returned to the unenrolled state. The user's status remains ACTIVE. This link is present only if the user is currently enrolled in one or more MFA factors.
///
///
/// The cancellation token.
@@ -133,7 +132,7 @@ public partial interface IUsersClient
Task ResetAllFactorsAsync(string userId, CancellationToken cancellationToken = default(CancellationToken));
///
- ///
+ /// Generates a one-time token (OTT) that can be used to reset a user's password. The OTT link can be automatically emailed to the user or returned to the API caller and distributed using a custom flow.
///
///
///
@@ -143,7 +142,7 @@ public partial interface IUsersClient
Task ResetPasswordAsync(string userId, AuthenticationProviderType provider = null, bool? sendEmail = null, CancellationToken cancellationToken = default(CancellationToken));
///
- ///
+ /// Suspends a user. This operation can only be performed on users with an `ACTIVE` status. The user will have a status of `SUSPENDED` when the process is complete.
///
///
/// The cancellation token.
@@ -151,7 +150,7 @@ public partial interface IUsersClient
Task SuspendUserAsync(string userId, CancellationToken cancellationToken = default(CancellationToken));
///
- ///
+ /// Unlocks a user with a `LOCKED_OUT` status and returns them to `ACTIVE` status. Users will be able to login with their current password.
///
///
/// The cancellation token.
@@ -159,7 +158,7 @@ public partial interface IUsersClient
Task UnlockUserAsync(string userId, CancellationToken cancellationToken = default(CancellationToken));
///
- ///
+ /// Unsuspends a user and returns them to the `ACTIVE` state. This operation can only be performed on users that have a `SUSPENDED` status.
///
///
/// The cancellation token.
@@ -167,7 +166,7 @@ public partial interface IUsersClient
Task UnsuspendUserAsync(string userId, CancellationToken cancellationToken = default(CancellationToken));
///
- ///
+ /// Lists all roles assigned to a user.
///
///
///
@@ -175,7 +174,7 @@ public partial interface IUsersClient
IAsyncEnumerable ListAssignedRoles(string userId, string expand = null);
///
- ///
+ /// Unassigns a role from a user.
///
///
///
diff --git a/src/Okta.Sdk/Generated/IVerifyFactorRequest.Generated.cs b/src/Okta.Sdk/Generated/IVerifyFactorRequest.Generated.cs
new file mode 100644
index 000000000..06cbbd0b7
--- /dev/null
+++ b/src/Okta.Sdk/Generated/IVerifyFactorRequest.Generated.cs
@@ -0,0 +1,27 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// Represents a VerifyFactorRequest resource in the Okta API.
+ public partial interface IVerifyFactorRequest : IResource
+ {
+ string ActivationToken { get; set; }
+
+ string Answer { get; set; }
+
+ string NextPassCode { get; set; }
+
+ string PassCode { get; set; }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/IVerifyFactorResponse.Generated.cs b/src/Okta.Sdk/Generated/IVerifyFactorResponse.Generated.cs
new file mode 100644
index 000000000..5a508c015
--- /dev/null
+++ b/src/Okta.Sdk/Generated/IVerifyFactorResponse.Generated.cs
@@ -0,0 +1,27 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// Represents a VerifyFactorResponse resource in the Okta API.
+ public partial interface IVerifyFactorResponse : IResource
+ {
+
+
+ DateTimeOffset? ExpiresAt { get; }
+
+ FactorResultType FactorResult { get; }
+
+ string FactorResultMessage { get; }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/IWebFactor.Generated.cs b/src/Okta.Sdk/Generated/IWebFactor.Generated.cs
new file mode 100644
index 000000000..fb29856a3
--- /dev/null
+++ b/src/Okta.Sdk/Generated/IWebFactor.Generated.cs
@@ -0,0 +1,21 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// Represents a WebFactor resource in the Okta API.
+ public partial interface IWebFactor : IFactor
+ {
+ new IWebFactorProfile Profile { get; set; }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/IWebFactorProfile.Generated.cs b/src/Okta.Sdk/Generated/IWebFactorProfile.Generated.cs
new file mode 100644
index 000000000..7574fa3ea
--- /dev/null
+++ b/src/Okta.Sdk/Generated/IWebFactorProfile.Generated.cs
@@ -0,0 +1,21 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// Represents a WebFactorProfile resource in the Okta API.
+ public partial interface IWebFactorProfile : IFactorProfile
+ {
+ string CredentialId { get; set; }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/PasswordCredential.Generated.cs b/src/Okta.Sdk/Generated/PasswordCredential.Generated.cs
index 31734531f..d6a646bb1 100644
--- a/src/Okta.Sdk/Generated/PasswordCredential.Generated.cs
+++ b/src/Okta.Sdk/Generated/PasswordCredential.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/PushFactor.Generated.cs b/src/Okta.Sdk/Generated/PushFactor.Generated.cs
new file mode 100644
index 000000000..d847d3570
--- /dev/null
+++ b/src/Okta.Sdk/Generated/PushFactor.Generated.cs
@@ -0,0 +1,27 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Okta.Sdk.Internal;
+
+namespace Okta.Sdk
+{
+ ///
+ public sealed partial class PushFactor : Factor, IPushFactor
+ {
+ ///
+ public new IPushFactorProfile Profile
+ {
+ get => GetResourceProperty("profile");
+ set => this["profile"] = value;
+ }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/PushFactorProfile.Generated.cs b/src/Okta.Sdk/Generated/PushFactorProfile.Generated.cs
new file mode 100644
index 000000000..b748502fc
--- /dev/null
+++ b/src/Okta.Sdk/Generated/PushFactorProfile.Generated.cs
@@ -0,0 +1,47 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Okta.Sdk.Internal;
+
+namespace Okta.Sdk
+{
+ ///
+ public sealed partial class PushFactorProfile : FactorProfile, IPushFactorProfile
+ {
+ ///
+ public string CredentialId
+ {
+ get => GetStringProperty("credentialId");
+ set => this["credentialId"] = value;
+ }
+
+ ///
+ public string DeviceType => GetStringProperty("deviceType");
+
+ ///
+ public string Name
+ {
+ get => GetStringProperty("name");
+ set => this["name"] = value;
+ }
+
+ ///
+ public string Platform => GetStringProperty("platform");
+
+ ///
+ public string Version
+ {
+ get => GetStringProperty("version");
+ set => this["version"] = value;
+ }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/RecoveryQuestionCredential.Generated.cs b/src/Okta.Sdk/Generated/RecoveryQuestionCredential.Generated.cs
index e2d0525d3..a3fa1f21f 100644
--- a/src/Okta.Sdk/Generated/RecoveryQuestionCredential.Generated.cs
+++ b/src/Okta.Sdk/Generated/RecoveryQuestionCredential.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/ResetPasswordToken.Generated.cs b/src/Okta.Sdk/Generated/ResetPasswordToken.Generated.cs
index 9315c978e..2c6cd7659 100644
--- a/src/Okta.Sdk/Generated/ResetPasswordToken.Generated.cs
+++ b/src/Okta.Sdk/Generated/ResetPasswordToken.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/Role.Generated.cs b/src/Okta.Sdk/Generated/Role.Generated.cs
index 6ff887093..908fe7768 100644
--- a/src/Okta.Sdk/Generated/Role.Generated.cs
+++ b/src/Okta.Sdk/Generated/Role.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/RoleStatus.Generated.cs b/src/Okta.Sdk/Generated/RoleStatus.Generated.cs
index 0d9efaf51..c997ee059 100644
--- a/src/Okta.Sdk/Generated/RoleStatus.Generated.cs
+++ b/src/Okta.Sdk/Generated/RoleStatus.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
namespace Okta.Sdk
{
diff --git a/src/Okta.Sdk/Generated/SecurityQuestion.Generated.cs b/src/Okta.Sdk/Generated/SecurityQuestion.Generated.cs
new file mode 100644
index 000000000..1387ca94f
--- /dev/null
+++ b/src/Okta.Sdk/Generated/SecurityQuestion.Generated.cs
@@ -0,0 +1,41 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Okta.Sdk.Internal;
+
+namespace Okta.Sdk
+{
+ ///
+ public sealed partial class SecurityQuestion : Resource, ISecurityQuestion
+ {
+ ///
+ public string Answer
+ {
+ get => GetStringProperty("answer");
+ set => this["answer"] = value;
+ }
+
+ ///
+ public string Question
+ {
+ get => GetStringProperty("question");
+ set => this["question"] = value;
+ }
+
+ ///
+ public string QuestionText
+ {
+ get => GetStringProperty("questionText");
+ set => this["questionText"] = value;
+ }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/SecurityQuestionFactor.Generated.cs b/src/Okta.Sdk/Generated/SecurityQuestionFactor.Generated.cs
new file mode 100644
index 000000000..c4a0e79a6
--- /dev/null
+++ b/src/Okta.Sdk/Generated/SecurityQuestionFactor.Generated.cs
@@ -0,0 +1,27 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Okta.Sdk.Internal;
+
+namespace Okta.Sdk
+{
+ ///
+ public sealed partial class SecurityQuestionFactor : Factor, ISecurityQuestionFactor
+ {
+ ///
+ public new ISecurityQuestionFactorProfile Profile
+ {
+ get => GetResourceProperty("profile");
+ set => this["profile"] = value;
+ }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/SecurityQuestionFactorProfile.Generated.cs b/src/Okta.Sdk/Generated/SecurityQuestionFactorProfile.Generated.cs
new file mode 100644
index 000000000..c70917a4e
--- /dev/null
+++ b/src/Okta.Sdk/Generated/SecurityQuestionFactorProfile.Generated.cs
@@ -0,0 +1,41 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Okta.Sdk.Internal;
+
+namespace Okta.Sdk
+{
+ ///
+ public sealed partial class SecurityQuestionFactorProfile : FactorProfile, ISecurityQuestionFactorProfile
+ {
+ ///
+ public string Answer
+ {
+ get => GetStringProperty("answer");
+ set => this["answer"] = value;
+ }
+
+ ///
+ public string Question
+ {
+ get => GetStringProperty("question");
+ set => this["question"] = value;
+ }
+
+ ///
+ public string QuestionText
+ {
+ get => GetStringProperty("questionText");
+ set => this["questionText"] = value;
+ }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/SmsFactor.Generated.cs b/src/Okta.Sdk/Generated/SmsFactor.Generated.cs
new file mode 100644
index 000000000..a716f2248
--- /dev/null
+++ b/src/Okta.Sdk/Generated/SmsFactor.Generated.cs
@@ -0,0 +1,27 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Okta.Sdk.Internal;
+
+namespace Okta.Sdk
+{
+ ///
+ public sealed partial class SmsFactor : Factor, ISmsFactor
+ {
+ ///
+ public new ISmsFactorProfile Profile
+ {
+ get => GetResourceProperty("profile");
+ set => this["profile"] = value;
+ }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/SmsFactorProfile.Generated.cs b/src/Okta.Sdk/Generated/SmsFactorProfile.Generated.cs
new file mode 100644
index 000000000..ee27f1113
--- /dev/null
+++ b/src/Okta.Sdk/Generated/SmsFactorProfile.Generated.cs
@@ -0,0 +1,27 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Okta.Sdk.Internal;
+
+namespace Okta.Sdk
+{
+ ///
+ public sealed partial class SmsFactorProfile : FactorProfile, ISmsFactorProfile
+ {
+ ///
+ public string PhoneNumber
+ {
+ get => GetStringProperty("phoneNumber");
+ set => this["phoneNumber"] = value;
+ }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/TempPassword.Generated.cs b/src/Okta.Sdk/Generated/TempPassword.Generated.cs
index 8cd54ff1b..bbe23326e 100644
--- a/src/Okta.Sdk/Generated/TempPassword.Generated.cs
+++ b/src/Okta.Sdk/Generated/TempPassword.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/TokenFactor.Generated.cs b/src/Okta.Sdk/Generated/TokenFactor.Generated.cs
new file mode 100644
index 000000000..5113504b5
--- /dev/null
+++ b/src/Okta.Sdk/Generated/TokenFactor.Generated.cs
@@ -0,0 +1,27 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Okta.Sdk.Internal;
+
+namespace Okta.Sdk
+{
+ ///
+ public sealed partial class TokenFactor : Factor, ITokenFactor
+ {
+ ///
+ public new ITokenFactorProfile Profile
+ {
+ get => GetResourceProperty("profile");
+ set => this["profile"] = value;
+ }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/TokenFactorProfile.Generated.cs b/src/Okta.Sdk/Generated/TokenFactorProfile.Generated.cs
new file mode 100644
index 000000000..491057867
--- /dev/null
+++ b/src/Okta.Sdk/Generated/TokenFactorProfile.Generated.cs
@@ -0,0 +1,27 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Okta.Sdk.Internal;
+
+namespace Okta.Sdk
+{
+ ///
+ public sealed partial class TokenFactorProfile : FactorProfile, ITokenFactorProfile
+ {
+ ///
+ public string CredentialId
+ {
+ get => GetStringProperty("credentialId");
+ set => this["credentialId"] = value;
+ }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/TotpFactor.Generated.cs b/src/Okta.Sdk/Generated/TotpFactor.Generated.cs
new file mode 100644
index 000000000..a1e911f31
--- /dev/null
+++ b/src/Okta.Sdk/Generated/TotpFactor.Generated.cs
@@ -0,0 +1,27 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Okta.Sdk.Internal;
+
+namespace Okta.Sdk
+{
+ ///
+ public sealed partial class TotpFactor : Factor, ITotpFactor
+ {
+ ///
+ public new ITotpFactorProfile Profile
+ {
+ get => GetResourceProperty("profile");
+ set => this["profile"] = value;
+ }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/TotpFactorProfile.Generated.cs b/src/Okta.Sdk/Generated/TotpFactorProfile.Generated.cs
new file mode 100644
index 000000000..2eb23fda7
--- /dev/null
+++ b/src/Okta.Sdk/Generated/TotpFactorProfile.Generated.cs
@@ -0,0 +1,27 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Okta.Sdk.Internal;
+
+namespace Okta.Sdk
+{
+ ///
+ public sealed partial class TotpFactorProfile : FactorProfile, ITotpFactorProfile
+ {
+ ///
+ public string CredentialId
+ {
+ get => GetStringProperty("credentialId");
+ set => this["credentialId"] = value;
+ }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/User.Generated.cs b/src/Okta.Sdk/Generated/User.Generated.cs
index 0afb8817a..e66b1e512 100644
--- a/src/Okta.Sdk/Generated/User.Generated.cs
+++ b/src/Okta.Sdk/Generated/User.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
@@ -92,5 +91,25 @@ public IUserProfile Profile
///
public Task AddToGroupAsync(string groupId, CancellationToken cancellationToken = default(CancellationToken))
=> GetClient().Groups.AddUserToGroupAsync(groupId, Id, cancellationToken);
+
+ ///
+ public Task AddFactorAsync(Factor factor, bool? updatePhone = false, string templateId = null, CancellationToken cancellationToken = default(CancellationToken))
+ => GetClient().UserFactors.AddFactorAsync(factor, Id, updatePhone, templateId, cancellationToken);
+
+ ///
+ public IAsyncEnumerable ListSupportedFactors()
+ => GetClient().UserFactors.ListSupportedFactors(Id);
+
+ ///
+ public IAsyncEnumerable ListFactors()
+ => GetClient().UserFactors.ListFactors(Id);
+
+ ///
+ public IAsyncEnumerable ListSupportedSecurityQuestions()
+ => GetClient().UserFactors.ListSupportedSecurityQuestions(Id);
+
+ ///
+ public Task GetFactorAsync(string factorId, CancellationToken cancellationToken = default(CancellationToken))
+ => GetClient().UserFactors.GetFactorAsync(Id, factorId, cancellationToken);
}
}
diff --git a/src/Okta.Sdk/Generated/UserActivationToken.Generated.cs b/src/Okta.Sdk/Generated/UserActivationToken.Generated.cs
index e6e6c366b..3ce341d29 100644
--- a/src/Okta.Sdk/Generated/UserActivationToken.Generated.cs
+++ b/src/Okta.Sdk/Generated/UserActivationToken.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/UserCredentials.Generated.cs b/src/Okta.Sdk/Generated/UserCredentials.Generated.cs
index 6c0d4a25b..0ce3183b7 100644
--- a/src/Okta.Sdk/Generated/UserCredentials.Generated.cs
+++ b/src/Okta.Sdk/Generated/UserCredentials.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/UserFactorsClient.Generated.cs b/src/Okta.Sdk/Generated/UserFactorsClient.Generated.cs
new file mode 100644
index 000000000..62e2c5e7f
--- /dev/null
+++ b/src/Okta.Sdk/Generated/UserFactorsClient.Generated.cs
@@ -0,0 +1,140 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.Extensions.Logging;
+using Okta.Sdk.Configuration;
+using Okta.Sdk.Internal;
+
+namespace Okta.Sdk
+{
+ ///
+ public sealed partial class UserFactorsClient : OktaClient, IUserFactorsClient
+ {
+ // Remove parameterless constructor
+ private UserFactorsClient()
+ {
+ }
+
+ internal UserFactorsClient(IDataStore dataStore, OktaClientConfiguration configuration, RequestContext requestContext)
+ : base(dataStore, configuration, requestContext)
+ {
+ }
+
+ ///
+ public IAsyncEnumerable ListFactors(string userId)
+ => GetCollectionClient(new HttpRequest
+ {
+ Uri = "/api/v1/users/{userId}/factors",
+
+ PathParameters = new Dictionary()
+ {
+ ["userId"] = userId,
+ },
+ });
+
+ ///
+ public async Task AddFactorAsync(IFactor factor, string userId, bool? updatePhone = false, string templateId = null, CancellationToken cancellationToken = default(CancellationToken))
+ => await PostAsync(new HttpRequest
+ {
+ Uri = "/api/v1/users/{userId}/factors",
+ Payload = factor,
+ PathParameters = new Dictionary()
+ {
+ ["userId"] = userId,
+ },
+ QueryParameters = new Dictionary()
+ {
+ ["updatePhone"] = updatePhone,
+ ["templateId"] = templateId,
+ },
+ }, cancellationToken).ConfigureAwait(false);
+
+ ///
+ public IAsyncEnumerable ListSupportedFactors(string userId)
+ => GetCollectionClient(new HttpRequest
+ {
+ Uri = "/api/v1/users/{userId}/factors/catalog",
+
+ PathParameters = new Dictionary()
+ {
+ ["userId"] = userId,
+ },
+ });
+
+ ///
+ public IAsyncEnumerable ListSupportedSecurityQuestions(string userId)
+ => GetCollectionClient(new HttpRequest
+ {
+ Uri = "/api/v1/users/{userId}/factors/questions",
+
+ PathParameters = new Dictionary()
+ {
+ ["userId"] = userId,
+ },
+ });
+
+ ///
+ public async Task DeleteFactorAsync(string userId, string factorId, CancellationToken cancellationToken = default(CancellationToken))
+ => await DeleteAsync(new HttpRequest
+ {
+ Uri = "/api/v1/users/{userId}/factors/{factorId}",
+
+ PathParameters = new Dictionary()
+ {
+ ["userId"] = userId,
+ ["factorId"] = factorId,
+ },
+ }, cancellationToken).ConfigureAwait(false);
+
+ ///
+ public async Task GetFactorAsync(string userId, string factorId, CancellationToken cancellationToken = default(CancellationToken))
+ => await GetAsync(new HttpRequest
+ {
+ Uri = "/api/v1/users/{userId}/factors/{factorId}",
+
+ PathParameters = new Dictionary()
+ {
+ ["userId"] = userId,
+ ["factorId"] = factorId,
+ },
+ }, cancellationToken).ConfigureAwait(false);
+
+ ///
+ public async Task ActivateFactorAsync(IVerifyFactorRequest verifyFactorRequest, string userId, string factorId, CancellationToken cancellationToken = default(CancellationToken))
+ => await PostAsync(new HttpRequest
+ {
+ Uri = "/api/v1/users/{userId}/factors/{factorId}/lifecycle/activate",
+ Payload = verifyFactorRequest,
+ PathParameters = new Dictionary()
+ {
+ ["userId"] = userId,
+ ["factorId"] = factorId,
+ },
+ }, cancellationToken).ConfigureAwait(false);
+
+ ///
+ public async Task VerifyFactorAsync(IVerifyFactorRequest verifyFactorRequest, string userId, string factorId, string templateId = null, CancellationToken cancellationToken = default(CancellationToken))
+ => await PostAsync(new HttpRequest
+ {
+ Uri = "/api/v1/users/{userId}/factors/{factorId}/verify",
+ Payload = verifyFactorRequest,
+ PathParameters = new Dictionary()
+ {
+ ["userId"] = userId,
+ ["factorId"] = factorId,
+ },
+ QueryParameters = new Dictionary()
+ {
+ ["templateId"] = templateId,
+ },
+ }, cancellationToken).ConfigureAwait(false);
+ }
+}
diff --git a/src/Okta.Sdk/Generated/UserProfile.Generated.cs b/src/Okta.Sdk/Generated/UserProfile.Generated.cs
index 776107c6a..4721c1c8b 100644
--- a/src/Okta.Sdk/Generated/UserProfile.Generated.cs
+++ b/src/Okta.Sdk/Generated/UserProfile.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/UserStatus.Generated.cs b/src/Okta.Sdk/Generated/UserStatus.Generated.cs
index 391f1dec1..e457e88f4 100644
--- a/src/Okta.Sdk/Generated/UserStatus.Generated.cs
+++ b/src/Okta.Sdk/Generated/UserStatus.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
namespace Okta.Sdk
{
diff --git a/src/Okta.Sdk/Generated/UsersClient.Generated.cs b/src/Okta.Sdk/Generated/UsersClient.Generated.cs
index 085518828..0ba539b3b 100644
--- a/src/Okta.Sdk/Generated/UsersClient.Generated.cs
+++ b/src/Okta.Sdk/Generated/UsersClient.Generated.cs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - 0.3.0
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
diff --git a/src/Okta.Sdk/Generated/VerifyFactorRequest.Generated.cs b/src/Okta.Sdk/Generated/VerifyFactorRequest.Generated.cs
new file mode 100644
index 000000000..50d2dd19a
--- /dev/null
+++ b/src/Okta.Sdk/Generated/VerifyFactorRequest.Generated.cs
@@ -0,0 +1,48 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Okta.Sdk.Internal;
+
+namespace Okta.Sdk
+{
+ ///
+ public sealed partial class VerifyFactorRequest : Resource, IVerifyFactorRequest
+ {
+ ///
+ public string ActivationToken
+ {
+ get => GetStringProperty("activationToken");
+ set => this["activationToken"] = value;
+ }
+
+ ///
+ public string Answer
+ {
+ get => GetStringProperty("answer");
+ set => this["answer"] = value;
+ }
+
+ ///
+ public string NextPassCode
+ {
+ get => GetStringProperty("nextPassCode");
+ set => this["nextPassCode"] = value;
+ }
+
+ ///
+ public string PassCode
+ {
+ get => GetStringProperty("passCode");
+ set => this["passCode"] = value;
+ }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/VerifyFactorResponse.Generated.cs b/src/Okta.Sdk/Generated/VerifyFactorResponse.Generated.cs
new file mode 100644
index 000000000..7c0249b80
--- /dev/null
+++ b/src/Okta.Sdk/Generated/VerifyFactorResponse.Generated.cs
@@ -0,0 +1,31 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Okta.Sdk.Internal;
+
+namespace Okta.Sdk
+{
+ ///
+ public sealed partial class VerifyFactorResponse : Resource, IVerifyFactorResponse
+ {
+
+
+ ///
+ public DateTimeOffset? ExpiresAt => GetDateTimeProperty("expiresAt");
+
+ ///
+ public FactorResultType FactorResult => GetEnumProperty("factorResult");
+
+ ///
+ public string FactorResultMessage => GetStringProperty("factorResultMessage");
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/WebFactor.Generated.cs b/src/Okta.Sdk/Generated/WebFactor.Generated.cs
new file mode 100644
index 000000000..6bcc04835
--- /dev/null
+++ b/src/Okta.Sdk/Generated/WebFactor.Generated.cs
@@ -0,0 +1,27 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Okta.Sdk.Internal;
+
+namespace Okta.Sdk
+{
+ ///
+ public sealed partial class WebFactor : Factor, IWebFactor
+ {
+ ///
+ public new IWebFactorProfile Profile
+ {
+ get => GetResourceProperty("profile");
+ set => this["profile"] = value;
+ }
+
+ }
+}
diff --git a/src/Okta.Sdk/Generated/WebFactorProfile.Generated.cs b/src/Okta.Sdk/Generated/WebFactorProfile.Generated.cs
new file mode 100644
index 000000000..8689ebb42
--- /dev/null
+++ b/src/Okta.Sdk/Generated/WebFactorProfile.Generated.cs
@@ -0,0 +1,27 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+// This file was automatically generated. Don't modify it directly.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Okta.Sdk.Internal;
+
+namespace Okta.Sdk
+{
+ ///
+ public sealed partial class WebFactorProfile : FactorProfile, IWebFactorProfile
+ {
+ ///
+ public string CredentialId
+ {
+ get => GetStringProperty("credentialId");
+ set => this["credentialId"] = value;
+ }
+
+ }
+}
diff --git a/src/Okta.Sdk/IGroupsClient.cs b/src/Okta.Sdk/IGroupsClient.cs
index edb059b62..532102293 100644
--- a/src/Okta.Sdk/IGroupsClient.cs
+++ b/src/Okta.Sdk/IGroupsClient.cs
@@ -9,7 +9,7 @@
namespace Okta.Sdk
{
- /// A client that works with resources.
+ /// A client that works with Okta Group resources.
public partial interface IGroupsClient : IAsyncEnumerable
{
///
diff --git a/src/Okta.Sdk/IOktaClient.cs b/src/Okta.Sdk/IOktaClient.cs
index b30899c71..5e50ef5d7 100644
--- a/src/Okta.Sdk/IOktaClient.cs
+++ b/src/Okta.Sdk/IOktaClient.cs
@@ -32,6 +32,14 @@ public interface IOktaClient
///
IUsersClient Users { get; }
+ ///
+ /// Gets a UserFactorsClient that interacts with the Okta Factors API.
+ ///
+ ///
+ /// A UserFactorsClient that interacts with the Okta Factors API.
+ ///
+ IUserFactorsClient UserFactors { get; }
+
///
/// Gets a GroupsClient that interacts with the Okta Groups API.
///
diff --git a/src/Okta.Sdk/IResource.cs b/src/Okta.Sdk/IResource.cs
index 9ef8ebd68..d061ee500 100644
--- a/src/Okta.Sdk/IResource.cs
+++ b/src/Okta.Sdk/IResource.cs
@@ -52,4 +52,4 @@ public interface IResource
/// The strongly-typed property value, or null.
T GetProperty(string name);
}
-}
\ No newline at end of file
+}
diff --git a/src/Okta.Sdk/IUser.cs b/src/Okta.Sdk/IUser.cs
index 66d6d0b1b..14413d31b 100644
--- a/src/Okta.Sdk/IUser.cs
+++ b/src/Okta.Sdk/IUser.cs
@@ -18,6 +18,8 @@ public partial interface IUser
IAsyncEnumerable Groups { get; }
+ IAsyncEnumerable Factors { get; }
+
Task ChangePasswordAsync(ChangePasswordOptions options, CancellationToken cancellationToken = default(CancellationToken));
Task ResetPasswordAsync(bool? sendEmail = true, CancellationToken cancellationToken = default(CancellationToken));
@@ -35,5 +37,14 @@ public partial interface IUser
/// The cancellation token.
/// The updated User.
Task UpdateAsync(CancellationToken cancellationToken = default(CancellationToken));
+
+ Task AddFactorAsync(AddSecurityQuestionFactorOptions securityQuestionFactorOptions, CancellationToken cancellationToken = default(CancellationToken));
+ Task AddFactorAsync(AddCallFactorOptions callFactorOptions, CancellationToken cancellationToken = default(CancellationToken));
+ Task AddFactorAsync(AddEmailFactorOptions emailFactorOptions, CancellationToken cancellationToken = default(CancellationToken));
+ Task AddFactorAsync(AddHardwareFactorOptions hardwareFactorOptions, CancellationToken cancellationToken = default(CancellationToken));
+ Task AddFactorAsync(AddPushFactorOptions pushFactorOptions, CancellationToken cancellationToken = default(CancellationToken));
+ Task AddFactorAsync(AddSmsFactorOptions smsFactorOptions, CancellationToken cancellationToken = default(CancellationToken));
+ Task AddFactorAsync(AddTokenFactorOptions tokenFactorOptions, CancellationToken cancellationToken = default(CancellationToken));
+ Task AddFactorAsync(AddTotpFactorOptions totpFactorOptions, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/src/Okta.Sdk/IUserFactorsClient.cs b/src/Okta.Sdk/IUserFactorsClient.cs
new file mode 100644
index 000000000..231c2e6e6
--- /dev/null
+++ b/src/Okta.Sdk/IUserFactorsClient.cs
@@ -0,0 +1,26 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// A client that works with Okta UserFactor resources.
+ public partial interface IUserFactorsClient
+ {
+ Task AddFactorAsync(string userId, AddSecurityQuestionFactorOptions securityQuestionFactorOptions, CancellationToken cancellationToken = default(CancellationToken));
+ Task AddFactorAsync(string userId, AddCallFactorOptions callFactorOptions, CancellationToken cancellationToken = default(CancellationToken));
+ Task AddFactorAsync(string userId, AddEmailFactorOptions emailFactorOptions, CancellationToken cancellationToken = default(CancellationToken));
+ Task AddFactorAsync(string userId, AddHardwareFactorOptions hardwareFactorOptions, CancellationToken cancellationToken = default(CancellationToken));
+ Task AddFactorAsync(string userId, AddPushFactorOptions pushFactorOptions, CancellationToken cancellationToken = default(CancellationToken));
+ Task AddFactorAsync(string userId, AddSmsFactorOptions smsFactorOptions, CancellationToken cancellationToken = default(CancellationToken));
+ Task AddFactorAsync(string userId, AddTokenFactorOptions tokenFactorOptions, CancellationToken cancellationToken = default(CancellationToken));
+ Task AddFactorAsync(string userId, AddTotpFactorOptions totpFactorOptions, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/src/Okta.Sdk/IUsersClient.cs b/src/Okta.Sdk/IUsersClient.cs
index 57e269699..65578836c 100644
--- a/src/Okta.Sdk/IUsersClient.cs
+++ b/src/Okta.Sdk/IUsersClient.cs
@@ -9,7 +9,7 @@
namespace Okta.Sdk
{
- /// A client that works with resources.
+ /// A client that works with Okta User resources.
public partial interface IUsersClient : IAsyncEnumerable
{
///
diff --git a/src/Okta.Sdk/Internal/AbstractResourceTypeResolver.cs b/src/Okta.Sdk/Internal/AbstractResourceTypeResolver.cs
new file mode 100644
index 000000000..504af63a2
--- /dev/null
+++ b/src/Okta.Sdk/Internal/AbstractResourceTypeResolver.cs
@@ -0,0 +1,25 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Okta.Sdk.Internal
+{
+ ///
+ /// Resolves a resource type based on the resource data. Base class for all resource type resolvers.
+ ///
+ /// The base type of resource to resolve.
+ public abstract class AbstractResourceTypeResolver
+ {
+ ///
+ /// Get the resolved resource type given its .
+ ///
+ /// The resource data.
+ /// The resource type.
+ public abstract Type GetResolvedType(IDictionary data);
+ }
+}
diff --git a/src/Okta.Sdk/Internal/DefaultRequestExecutor.cs b/src/Okta.Sdk/Internal/DefaultRequestExecutor.cs
index 56a036ce1..aa2d49b96 100644
--- a/src/Okta.Sdk/Internal/DefaultRequestExecutor.cs
+++ b/src/Okta.Sdk/Internal/DefaultRequestExecutor.cs
@@ -200,7 +200,7 @@ public Task> PutAsync(string href, IEnumerable
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Collections.Generic;
+
+namespace Okta.Sdk.Internal
+{
+ internal sealed class DefaultResourceTypeResolver : AbstractResourceTypeResolver
+ {
+ public override Type GetResolvedType(IDictionary data)
+ => typeof(T);
+ }
+}
diff --git a/src/Okta.Sdk/Internal/ResourceFactory.cs b/src/Okta.Sdk/Internal/ResourceFactory.cs
index 576b27981..2a7d33a8d 100644
--- a/src/Okta.Sdk/Internal/ResourceFactory.cs
+++ b/src/Okta.Sdk/Internal/ResourceFactory.cs
@@ -64,7 +64,11 @@ public T CreateFromExistingData(IDictionary existingDictionar
throw new InvalidOperationException("Resources must inherit from the Resource class.");
}
- var resource = Activator.CreateInstance() as Resource;
+ var typeResolver = ResourceTypeResolver.Create();
+ var resourceType = typeResolver.GetResolvedType(existingDictionary);
+
+ var resource = Activator.CreateInstance(resourceType) as Resource;
+
resource.Initialize(_client, this, existingDictionary, _logger);
return (T)(object)resource;
}
@@ -82,7 +86,11 @@ public T CreateNew(IDictionary data)
throw new InvalidOperationException("Resources must inherit from the Resource class.");
}
- var resource = Activator.CreateInstance() as Resource;
+ var typeResolver = ResourceTypeResolver.Create();
+ var resourceType = typeResolver.GetResolvedType(data);
+
+ var resource = Activator.CreateInstance(resourceType) as Resource;
+
var dictionary = NewDictionary(resource.DictionaryType, data);
resource.Initialize(_client, this, dictionary, _logger);
return (T)(object)resource;
diff --git a/src/Okta.Sdk/Internal/ResourceTypeResolver.cs b/src/Okta.Sdk/Internal/ResourceTypeResolver.cs
new file mode 100644
index 000000000..652f9925c
--- /dev/null
+++ b/src/Okta.Sdk/Internal/ResourceTypeResolver.cs
@@ -0,0 +1,46 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+
+namespace Okta.Sdk.Internal
+{
+ internal static class ResourceTypeResolver
+ {
+ private static readonly (Type Resolver, Type For)[] CachedResolvers =
+ typeof(Resource).GetTypeInfo().Assembly.DefinedTypes
+ .Where(typeInfo =>
+ {
+ if (typeInfo?.BaseType == null)
+ {
+ return false;
+ }
+
+ var baseTypeInfo = typeInfo.BaseType.GetTypeInfo();
+ var inheritsFromAbstractResolver = baseTypeInfo.IsGenericType
+ && baseTypeInfo.GetGenericTypeDefinition() == typeof(AbstractResourceTypeResolver<>);
+
+ return inheritsFromAbstractResolver;
+ })
+ .Select(typeInfo => (typeInfo.AsType(), typeInfo.BaseType.GenericTypeArguments[0]))
+ .ToArray();
+
+ public static AbstractResourceTypeResolver Create()
+ {
+ var resolver = CachedResolvers.FirstOrDefault(x => x.For == typeof(T)).Resolver;
+
+ if (resolver == null)
+ {
+ return new DefaultResourceTypeResolver();
+ }
+
+ return (AbstractResourceTypeResolver)Activator.CreateInstance(resolver);
+ }
+ }
+}
diff --git a/src/Okta.Sdk/Okta.Sdk.csproj b/src/Okta.Sdk/Okta.Sdk.csproj
index c7e91e722..b3e68d01c 100644
--- a/src/Okta.Sdk/Okta.Sdk.csproj
+++ b/src/Okta.Sdk/Okta.Sdk.csproj
@@ -16,6 +16,7 @@
+
diff --git a/src/Okta.Sdk/OktaClient.cs b/src/Okta.Sdk/OktaClient.cs
index 7e7ca61e8..c8f84a4f6 100644
--- a/src/Okta.Sdk/OktaClient.cs
+++ b/src/Okta.Sdk/OktaClient.cs
@@ -61,6 +61,7 @@ public OktaClient(OktaClientConfiguration apiClientConfiguration = null, ILogger
/// Initializes a new instance of the class.
///
/// The DataStore to use.
+ /// The client configuration.
/// The request context, if any.
protected OktaClient(IDataStore dataStore, OktaClientConfiguration configuration, RequestContext requestContext)
{
@@ -111,6 +112,9 @@ private static void ThrowIfInvalidConfiguration(OktaClientConfiguration configur
///
public IUsersClient Users => new UsersClient(_dataStore, Configuration, _requestContext);
+ ///
+ public IUserFactorsClient UserFactors => new UserFactorsClient(_dataStore, Configuration, _requestContext);
+
///
public IGroupsClient Groups => new GroupsClient(_dataStore, Configuration, _requestContext);
diff --git a/src/Okta.Sdk/User.cs b/src/Okta.Sdk/User.cs
index 8909c9262..4bf4c29f4 100644
--- a/src/Okta.Sdk/User.cs
+++ b/src/Okta.Sdk/User.cs
@@ -26,6 +26,10 @@ public IAsyncEnumerable Roles
public IAsyncEnumerable Groups
=> GetClient().Users.ListUserGroups(Id);
+ ///
+ public IAsyncEnumerable Factors
+ => GetClient().UserFactors.ListFactors(Id);
+
///
public Task ChangePasswordAsync(ChangePasswordOptions options, CancellationToken cancellationToken = default(CancellationToken))
=> GetClient().Users.ChangePasswordAsync(Id, options, cancellationToken);
@@ -49,5 +53,29 @@ public IAsyncEnumerable Groups
///
public Task UpdateAsync(CancellationToken cancellationToken = default(CancellationToken))
=> GetClient().Users.UpdateUserAsync(this, Id, cancellationToken);
+
+ public Task AddFactorAsync(AddSecurityQuestionFactorOptions securityQuestionFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
+ => GetClient().UserFactors.AddFactorAsync(Id, securityQuestionFactorOptions, cancellationToken);
+
+ public Task AddFactorAsync(AddCallFactorOptions callFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
+ => GetClient().UserFactors.AddFactorAsync(Id, callFactorOptions, cancellationToken);
+
+ public Task AddFactorAsync(AddEmailFactorOptions emailFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
+ => GetClient().UserFactors.AddFactorAsync(Id, emailFactorOptions, cancellationToken);
+
+ public Task AddFactorAsync(AddHardwareFactorOptions hardwareFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
+ => GetClient().UserFactors.AddFactorAsync(Id, hardwareFactorOptions, cancellationToken);
+
+ public Task AddFactorAsync(AddPushFactorOptions pushFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
+ => GetClient().UserFactors.AddFactorAsync(Id, pushFactorOptions, cancellationToken);
+
+ public Task AddFactorAsync(AddSmsFactorOptions smsFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
+ => GetClient().UserFactors.AddFactorAsync(Id, smsFactorOptions, cancellationToken);
+
+ public Task AddFactorAsync(AddTokenFactorOptions tokenFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
+ => GetClient().UserFactors.AddFactorAsync(Id, tokenFactorOptions, cancellationToken);
+
+ public Task AddFactorAsync(AddTotpFactorOptions totpFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
+ => GetClient().UserFactors.AddFactorAsync(Id, totpFactorOptions, cancellationToken);
}
}
diff --git a/src/Okta.Sdk/UserFactorsClient.cs b/src/Okta.Sdk/UserFactorsClient.cs
new file mode 100644
index 000000000..29beebb98
--- /dev/null
+++ b/src/Okta.Sdk/UserFactorsClient.cs
@@ -0,0 +1,213 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Okta.Sdk
+{
+ /// A client that works with Okta UserFactor resources.
+ public sealed partial class UserFactorsClient : OktaClient, IUserFactorsClient
+ {
+ ///
+ public Task AddFactorAsync(string userId, AddSecurityQuestionFactorOptions securityQuestionFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (securityQuestionFactorOptions == null)
+ {
+ throw new ArgumentNullException(nameof(securityQuestionFactorOptions));
+ }
+
+ var profile = new SecurityQuestionFactorProfile
+ {
+ Question = securityQuestionFactorOptions.Question,
+ Answer = securityQuestionFactorOptions.Answer,
+ };
+
+ var factor = new SecurityQuestionFactor
+ {
+ FactorType = FactorType.Question,
+ Provider = FactorProvider.Okta,
+ Profile = profile,
+ };
+
+ return AddFactorAsync(factor, userId, cancellationToken: cancellationToken);
+ }
+
+ ///
+ public Task AddFactorAsync(string userId, AddCallFactorOptions callFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (callFactorOptions == null)
+ {
+ throw new ArgumentNullException(nameof(callFactorOptions));
+ }
+
+ var profile = new CallFactorProfile
+ {
+ PhoneExtension = callFactorOptions.PhoneExtension,
+ PhoneNumber = callFactorOptions.PhoneNumber
+ };
+
+ var factor = new CallFactor
+ {
+ FactorType = FactorType.Call,
+ Provider = FactorProvider.Okta,
+ Profile = profile,
+ };
+
+ return AddFactorAsync(factor, userId, cancellationToken: cancellationToken);
+ }
+
+ ///
+ public Task AddFactorAsync(string userId, AddEmailFactorOptions emailFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (emailFactorOptions == null)
+ {
+ throw new ArgumentNullException(nameof(emailFactorOptions));
+ }
+
+ var profile = new EmailFactorProfile
+ {
+ Email = emailFactorOptions.Email
+ };
+
+ var factor = new EmailFactor
+ {
+ FactorType = FactorType.Email,
+ Provider = FactorProvider.Okta,
+ Profile = profile,
+ };
+
+ return AddFactorAsync(factor, userId, cancellationToken: cancellationToken);
+ }
+
+ ///
+ public Task AddFactorAsync(string userId, AddHardwareFactorOptions hardwareFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (hardwareFactorOptions == null)
+ {
+ throw new ArgumentNullException(nameof(hardwareFactorOptions));
+ }
+
+ if (hardwareFactorOptions.Provider == null)
+ {
+ throw new ArgumentNullException(nameof(hardwareFactorOptions.Provider));
+ }
+
+ var verify = new VerifyFactorRequest
+ {
+ PassCode = hardwareFactorOptions.PassCode
+ };
+
+ var factor = new HardwareFactor
+ {
+ FactorType = FactorType.TokenHardware,
+ Provider = hardwareFactorOptions.Provider,
+ Verify = verify
+ };
+
+ return AddFactorAsync(factor, userId, cancellationToken: cancellationToken);
+ }
+
+ ///
+ public Task AddFactorAsync(string userId, AddPushFactorOptions pushFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (pushFactorOptions == null)
+ {
+ throw new ArgumentNullException(nameof(pushFactorOptions));
+ }
+
+ var factor = new PushFactor
+ {
+ FactorType = FactorType.Push,
+ Provider = FactorProvider.Okta
+ };
+
+ return AddFactorAsync(factor, userId, cancellationToken: cancellationToken);
+ }
+
+ ///
+ public Task AddFactorAsync(string userId, AddSmsFactorOptions smsFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (smsFactorOptions == null)
+ {
+ throw new ArgumentNullException(nameof(smsFactorOptions));
+ }
+
+ var profile = new SmsFactorProfile
+ {
+ PhoneNumber = smsFactorOptions.PhoneNumber
+ };
+
+ var factor = new SmsFactor
+ {
+ FactorType = FactorType.Sms,
+ Provider = FactorProvider.Okta,
+ Profile = profile,
+ };
+
+ return AddFactorAsync(factor, userId, cancellationToken: cancellationToken);
+ }
+
+ ///
+ public Task AddFactorAsync(string userId, AddTokenFactorOptions tokenFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (tokenFactorOptions == null)
+ {
+ throw new ArgumentNullException(nameof(tokenFactorOptions));
+ }
+
+ if (tokenFactorOptions.Provider == null)
+ {
+ throw new ArgumentNullException(nameof(tokenFactorOptions.Provider));
+ }
+
+ var profile = new TokenFactorProfile
+ {
+ CredentialId = tokenFactorOptions.CredentialId
+ };
+
+ var verify = new VerifyFactorRequest
+ {
+ PassCode = tokenFactorOptions.PassCode,
+ NextPassCode = tokenFactorOptions.NextPassCode
+ };
+
+ var factor = new TokenFactor
+ {
+ FactorType = FactorType.Token,
+ Provider = tokenFactorOptions.Provider,
+ Profile = profile,
+ Verify = verify
+ };
+
+ return AddFactorAsync(factor, userId, cancellationToken: cancellationToken);
+ }
+
+ ///
+ public Task AddFactorAsync(string userId, AddTotpFactorOptions totpFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (totpFactorOptions == null)
+ {
+ throw new ArgumentNullException(nameof(totpFactorOptions));
+ }
+
+ if (totpFactorOptions.Provider == null)
+ {
+ throw new ArgumentNullException(nameof(totpFactorOptions.Provider));
+ }
+
+ var factor = new TotpFactor
+ {
+ FactorType = FactorType.TokenSoftwareTotp,
+ Provider = totpFactorOptions.Provider
+ };
+
+ return AddFactorAsync(factor, userId, cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/templates/Client.cs.hbs b/templates/Client.cs.hbs
index cdf13c4e4..e1d5d0d20 100644
--- a/templates/Client.cs.hbs
+++ b/templates/Client.cs.hbs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - {{spec.info.version}}
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
@@ -53,7 +52,10 @@ namespace Okta.Sdk
{{~#each allParams}}
{{~paramToCLRType this}}{{nbsp}}
{{~name}}
- {{~#if (exists this "default")}} = {{default}}
+ {{~#if (exists this "default")}}
+ {{~nbsp}}= {{#if (eq this.type "string")}}"{{/if}}
+ {{~nbsp 0}}{{default}}
+ {{~nbsp 0}}{{#if (eq this.type "string")}}"{{/if}}
{{~else}}
{{~#unless required}} = null{{/unless}}
{{~/if}}
diff --git a/templates/Enum.cs.hbs b/templates/Enum.cs.hbs
index 76e9890b6..4b086a71b 100644
--- a/templates/Enum.cs.hbs
+++ b/templates/Enum.cs.hbs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - {{specVersion}}
+// This file was automatically generated. Don't modify it directly.
namespace Okta.Sdk
{
diff --git a/templates/IClient.cs.hbs b/templates/IClient.cs.hbs
index e13c97177..b9161d3c3 100644
--- a/templates/IClient.cs.hbs
+++ b/templates/IClient.cs.hbs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - {{spec.info.version}}
+// This file was automatically generated. Don't modify it directly.
using System.Collections.Generic;
using System.Threading;
@@ -12,7 +11,7 @@ using System.Threading.Tasks;
namespace Okta.Sdk
{
- /// A client that works with resources.
+ /// A client that works with Okta {{tag}} resources.
public partial interface I{{tag}}sClient
{
{{~#each operations as |operation|}}
@@ -60,7 +59,10 @@ namespace Okta.Sdk
{{~#each allParams}}
{{~paramToCLRType this}}{{nbsp}}
{{~name}}
- {{~#if (exists this "default")}} = {{default}}
+ {{~#if (exists this "default")}}
+ {{~nbsp}}= {{#if (eq this.type "string")}}"{{/if}}
+ {{~nbsp 0}}{{default}}
+ {{~nbsp 0}}{{#if (eq this.type "string")}}"{{/if}}
{{~else}}
{{~#unless required}} = null{{/unless}}
{{~/if}}
diff --git a/templates/IModel.cs.hbs b/templates/IModel.cs.hbs
index 702f5c017..90861d50e 100644
--- a/templates/IModel.cs.hbs
+++ b/templates/IModel.cs.hbs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - {{specVersion}}
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
@@ -14,11 +13,11 @@ using System.Threading.Tasks;
namespace Okta.Sdk
{
/// Represents a {{modelName}} resource in the Okta API.
- public partial interface I{{modelName}} : IResource
+ public partial interface I{{modelName}} : {{#if extends}}I{{extends}}{{else}}IResource{{/if}}
{
{{#each properties}}
{{~#unless hidden}}
- {{{propToCLRType this true}}} {{pascalCase (or displayName propertyName)}}
+ {{#if hidesBaseMember}}new {{/if}}{{{propToCLRType this true}}} {{pascalCase (or displayName propertyName)}}
{{~#if readOnly}} { get; }
{{~else}} { get; set; }
{{~/if}}
@@ -40,12 +39,17 @@ namespace Okta.Sdk
{{~#unless operation.isArray}}Async{{/unless}}
{{~nbsp 0}}(
+
+ {{~#if operation.bodyModel}}{{operation.bodyModel}} {{camelCase operation.bodyModel}}, {{/if}}
{{~#each operation.allParams}}
{{~#unless (getMappedArgName method name)}}
{{~paramToCLRType this}}{{nbsp}}
{{~name}}
- {{~#if (exists this "default")}} = {{default}}
+ {{~#if (exists this "default")}}
+ {{~nbsp}}= {{#if (eq this.type "string")}}"{{/if}}
+ {{~nbsp 0}}{{default}}
+ {{~nbsp 0}}{{#if (eq this.type "string")}}"{{/if}}
{{~else}}
{{~#unless required}} = null{{/unless}}
{{~/if}}
@@ -53,7 +57,10 @@ namespace Okta.Sdk
{{~/unless}}
{{~/each}}
- {{~nbsp 0}}CancellationToken cancellationToken = default(CancellationToken));
+ {{~#unless operation.isArray}}
+ {{~nbsp 0}}CancellationToken cancellationToken = default(CancellationToken)
+ {{~/unless}}
+ {{~nbsp 0}});
{{nbsp 0}}
{{nbsp 0}}
{{~/unless}}
diff --git a/templates/Model.cs.hbs b/templates/Model.cs.hbs
index 2e6ac020b..558ea0fa4 100644
--- a/templates/Model.cs.hbs
+++ b/templates/Model.cs.hbs
@@ -3,8 +3,7 @@
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
//
-// Do not modify this file directly. This file was automatically generated with:
-// spec.json - {{specVersion}}
+// This file was automatically generated. Don't modify it directly.
using System;
using System.Collections.Generic;
@@ -15,14 +14,14 @@ using Okta.Sdk.Internal;
namespace Okta.Sdk
{
///
- public sealed partial class {{modelName}} : Resource, I{{modelName}}
+ public {{#unless isBaseModel}}sealed {{/unless}}partial class {{modelName}} : {{#if extends}}{{pascalCase extends}}{{else}}Resource{{/if}}, I{{modelName}}
{
{{nbsp 0}}
{{~#each properties}}
{{~#unless hidden}}
///
- public {{{propToCLRType this true}}} {{pascalCase (or displayName propertyName)}}
+ public {{#if hidesBaseMember}}new {{/if}}{{{propToCLRType this true}}} {{pascalCase (or displayName propertyName)}}
{{~#if readOnly}} => {{{getterName this}}}("{{propertyName}}");
{{~else}}
{{nbsp 0}}
@@ -56,11 +55,16 @@ namespace Okta.Sdk
{{~nbsp 0}}(
+ {{~#if operation.bodyModel}}{{operation.bodyModel}} {{camelCase operation.bodyModel}}, {{/if}}
+
{{~#each operation.allParams}}
{{~#unless (getMappedArgName method name)}}
{{~paramToCLRType this}}{{nbsp}}
{{~name}}
- {{~#if (exists this "default")}} = {{default}}
+ {{~#if (exists this "default")}}
+ {{~nbsp}}= {{#if (eq this.type "string")}}"{{/if}}
+ {{~nbsp 0}}{{default}}
+ {{~nbsp 0}}{{#if (eq this.type "string")}}"{{/if}}
{{~else}}
{{~#unless required}} = null{{/unless}}
{{~/if}}
@@ -68,12 +72,15 @@ namespace Okta.Sdk
{{~/unless}}
{{~/each}}
- {{~nbsp 0}}CancellationToken cancellationToken = default(CancellationToken))
+ {{~#unless operation.isArray}}
+ {{~nbsp 0}}CancellationToken cancellationToken = default(CancellationToken)
+ {{~/unless}}
+ {{~nbsp 0}})
{{nbsp 0}}
{{~nbsp 0}}=> GetClient().{{pascalCase operation.tags.[0]}}s.{{pascalCase operation.operationId}}
{{~#unless operation.isArray}}Async{{/unless}}
{{~nbsp 0}}(
- {{~#if operation.bodyModel}}this, {{/if}}
+ {{~#if operation.bodyModel}}{{camelCase operation.bodyModel}}, {{/if}}
{{~#each operation.allParams}}
{{~#if (getMappedArgName method name)}}{{pascalCase (getMappedArgName method name)}}
{{~else}}{{name}}
diff --git a/templates/Resolver.cs.hbs b/templates/Resolver.cs.hbs
new file mode 100644
index 000000000..96ac9877f
--- /dev/null
+++ b/templates/Resolver.cs.hbs
@@ -0,0 +1,43 @@
+//
+// Copyright (c) 2014-2017 Okta, Inc. All rights reserved.
+// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Okta.Sdk.Internal
+{
+ ///
+ /// Resolves {{modelName}} resources based on the {{pascalCase resolutionStrategy.propertyName}} property.
+ ///
+ public class {{modelName}}Resolver : AbstractResourceTypeResolver<{{modelName}}>
+ {
+ ///
+ /// Gets the type of a {{modelName}} resource given its .
+ ///
+ /// The resource data.
+ /// The resource type.
+ public override Type GetResolvedType(IDictionary data)
+ {
+ var value = data
+ ?.Where(kv => kv.Key.Equals("{{resolutionStrategy.propertyName}}", StringComparison.OrdinalIgnoreCase))
+ ?.FirstOrDefault().Value?.ToString();
+
+ if (string.IsNullOrEmpty(value))
+ {
+ return typeof({{modelName}});
+ }
+ {{nbsp 0}}{{~#each resolutionStrategy.valueToModelMapping}}
+ if (value.Equals("{{@key}}"))
+ {
+ return typeof({{this}});
+ }
+ {{nbsp 0}}
+ {{~/each}}
+
+ return typeof({{modelName}});
+ }
+ }
+}
diff --git a/templates/index.js b/templates/index.js
index 3177721a0..2878e22ef 100644
--- a/templates/index.js
+++ b/templates/index.js
@@ -11,18 +11,26 @@ const partialUpdateList = new Set([
'UserProfile'
]);
-const propertySkipList = [
- { path: 'FactorDevice.links', reason: 'Not currently supported' },
- { path: 'Link.hints', reason: 'Not currently supported' },
- { path: 'User._links', reason: 'Not currently supported' },
- { path: 'UserGroup._embedded', reason: 'Not currently supported' },
- { path: 'UserGroup._links', reason: 'Not currently supported' },
- { path: 'UserGroupStats._links', reason: 'Not currently supported' },
-];
-
-const propertyRenameList = [
- { path: 'ActivationToken.activationToken', new: 'token', reason: '.NET type name and member name cannot be identical' },
- { path: 'TempPassword.tempPassword', new: 'password', reason: '.NET type name and member name cannot be identical' }
+const propertyDetailsList = [
+ { path: 'FactorDevice.links', skip: true, skipReason: 'Not currently supported' },
+ { path: 'Link.hints', skip: true, skipReason: 'Not currently supported' },
+ { path: 'User._links', skip: true, skipReason: 'Not currently supported' },
+ { path: 'UserGroup._embedded', skip: true, skipReason: 'Not currently supported' },
+ { path: 'UserGroup._links', skip: true, skipReason: 'Not currently supported' },
+ { path: 'UserGroupStats._links', skip: true, skipReason: 'Not currently supported' },
+
+ { path: 'ActivationToken.activationToken', rename: 'token', renameReason: '.NET type name and member name cannot be identical' },
+ { path: 'TempPassword.tempPassword', rename: 'password', renameReason: '.NET type name and member name cannot be identical' },
+
+ { path: 'CallFactor.profile', hidesBaseMember: true },
+ { path: 'EmailFactor.profile', hidesBaseMember: true },
+ { path: 'HardwareFactor.profile', hidesBaseMember: true },
+ { path: 'PushFactor.profile', hidesBaseMember: true },
+ { path: 'SecurityQuestionFactor.profile', hidesBaseMember: true },
+ { path: 'SmsFactor.profile', hidesBaseMember: true },
+ { path: 'TokenFactor.profile', hidesBaseMember: true },
+ { path: 'TotpFactor.profile', hidesBaseMember: true },
+ { path: 'WebFactor.profile', hidesBaseMember: true },
];
const operationSkipList = [
@@ -110,6 +118,8 @@ csharp.process = ({spec, operations, models, handlebars}) => {
const templates = [];
+ let baseModels = new Set();
+
// add all the models
for (let model of models) {
model.specVersion = spec.info.version;
@@ -129,6 +139,10 @@ csharp.process = ({spec, operations, models, handlebars}) => {
model.supportsPartialUpdates = true;
}
+ if (model.extends && !baseModels.has(model.extends)) {
+ baseModels.add(model.extends);
+ }
+
model.properties = model.properties || [];
for (let property of model.properties) {
@@ -146,17 +160,22 @@ csharp.process = ({spec, operations, models, handlebars}) => {
continue;
}
- let skipRule = propertySkipList.find(x => x.path === fullPath);
- if (skipRule) {
- console.log('Skipping property', fullPath, `(Reason: ${skipRule.reason})`);
+ let propertyDetails = propertyDetailsList.find(x => x.path == fullPath);
+ if (!propertyDetails) continue;
+
+ if (propertyDetails.skip) {
+ console.log('Skipping property', fullPath, `(Reason: ${propertyDetails.skipReason})`);
property.hidden = true;
continue;
}
- let renameRule = propertyRenameList.find(x => x.path === fullPath);
- if (renameRule) {
- console.log(`Renaming property ${fullPath} to ${renameRule.new}`, `(Reason: ${renameRule.reason})`);
- property.displayName = renameRule.new;
+ if (propertyDetails.rename) {
+ console.log(`Renaming property ${fullPath} to ${propertyDetails.rename}`, `(Reason: ${propertyDetails.renameReason})`);
+ property.displayName = propertyDetails.rename;
+ }
+
+ if (propertyDetails.hidesBaseMember) {
+ property.hidesBaseMember = true;
}
}
@@ -175,6 +194,14 @@ csharp.process = ({spec, operations, models, handlebars}) => {
method.operation.allParams = (method.operation.pathParams || []).concat(method.operation.queryParams || []);
}
+ if (model.requiresResolution) {
+ templates.push({
+ src: 'Resolver.cs.hbs',
+ dest: `Generated/${model.modelName}Resolver.Generated.cs`,
+ context: model
+ });
+ }
+
templates.push({
src: 'IModel.cs.hbs',
dest: `Generated/I${model.modelName}.Generated.cs`,
@@ -188,6 +215,18 @@ csharp.process = ({spec, operations, models, handlebars}) => {
});
}
+ // Second pass to mark base models (models that are inherited from other models)
+ for (let name of baseModels) {
+ let foundModel = models.find(x => x.modelName === name);
+
+ if (!foundModel) {
+ console.warn(`Could not mark ${name} as a base model`);
+ continue;
+ }
+
+ foundModel.isBaseModel = true;
+ }
+
const taggedOperations = {};
// pre-process the operations and split into tags