diff --git a/.travis.yml b/.travis.yml index 37d6a1e49..4918c4b97 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,25 +18,6 @@ script: - if [[ $DEPLOY_DOCS = true && ($TRAVIS_PULL_REQUEST = false && $TRAVIS_BRANCH = master || "$TRAVIS_TAG" != "") ]]; then ./build.sh --target Docs; fi -deploy: -- provider: pages - skip_cleanup: true - github_token: "$GITHUB_TOKEN" - local_dir: docs/temp - email: deploy-dotnet@okta.com - name: ".NET Deployment Bot" - on: - condition: "$DEPLOY_DOCS = true" - tags: true -- provider: pages - skip_cleanup: true - github_token: "$GITHUB_TOKEN" - local_dir: docs/temp - email: deploy-dotnet@okta.com - name: ".NET Deployment Bot" - on: - condition: "$DEPLOY_DOCS = true && $TRAVIS_PULL_REQUEST = false" - branch: master notifications: slack: if: type = cron diff --git a/CHANGELOG.md b/CHANGELOG.md index 30d35941a..16be8731f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,11 @@ Running changelog of releases since `3.1.1` * [Zones API's endpoints](https://developer.okta.com/docs/reference/api/zones/) * [Mappings API's endpoints](https://developer.okta.com/docs/reference/api/mappings/) * [ThreatInsight configuration API's endpoints](https://developer.okta.com/docs/reference/api/threat-insight/) -- Add an overload for `GroupsClient.DeleteGroupRuleAsync` function. Now you can specify `removeUsers` parameter indicating whether to keep or remove users from groups assigned by this rule. +* [Authenticators API's endpoints](https://developer.okta.com/docs/reference/api/authenticators-admin/) +* [Org API's endpoints](https://developer.okta.com/docs/reference/api/org/) +* [GroupSchema API's endpoints](https://developer.okta.com/docs/reference/api/schemas/#group-schema-operations) +- Add an overload for `GroupsClient.DeleteGroupRuleAsync` method. Now you can specify `removeUsers` parameter indicating whether to keep or remove users from groups assigned by this rule. + ### Bug Fixes diff --git a/openapi/errata.js b/openapi/errata.js index aa830bd2b..68635e0be 100644 --- a/openapi/errata.js +++ b/openapi/errata.js @@ -145,6 +145,7 @@ const modelErrata = [ { path: 'CSRMetadataSubject', rename: 'CsrMetadataSubject', renameReason: 'Pattern consistency' }, { path: 'CSRMetadataSubjectAltNames', rename: 'CsrMetadataSubjectAltNames', renameReason: 'Pattern consistency' }, { path: 'UserSchema', includeNullValues: true }, + { path: 'GroupSchema', includeNullValues: true }, ]; const operationErrata = [ diff --git a/openapi/package-lock.json b/openapi/package-lock.json index 84287930a..9ea16d91a 100644 --- a/openapi/package-lock.json +++ b/openapi/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "@okta/openapi": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@okta/openapi/-/openapi-2.3.0.tgz", - "integrity": "sha512-hBr2Eyg3EFwCxTryHEaDgzr8sJijjxjYc4+iAqyeJ0aGERZYeY9KjY/qM8gCwpd/3um7ur16S1K5m4s/ITCFAA==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/@okta/openapi/-/openapi-2.7.1.tgz", + "integrity": "sha512-FsOgeD5AjMJIGfVKuPeDDbi0YkCKOSUc0lhB2Ik6hMXbDDCZTTMgcI+4o1+IOZTr9pssCx/11kU4MWXGGousuw==", "dev": true, "requires": { "commander": "2.9.0", @@ -20,9 +20,9 @@ } }, "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "ansi-styles": { @@ -146,9 +146,9 @@ "dev": true }, "graceful-fs": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", - "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", + "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==", "dev": true }, "graceful-readlink": { @@ -276,10 +276,13 @@ "dev": true }, "node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", - "dev": true + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz", + "integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==", + "dev": true, + "requires": { + "whatwg-url": "^5.0.0" + } }, "ono": { "version": "6.0.1", @@ -360,23 +363,23 @@ "dev": true }, "string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "strip-ansi": "^6.0.1" } }, "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" } }, "supports-color": { @@ -422,10 +425,16 @@ "z-schema": "^4.2.2" } }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=", + "dev": true + }, "uglify-js": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.0.tgz", - "integrity": "sha512-TWYSWa9T2pPN4DIJYbU9oAjQx+5qdV5RUDxwARg8fmJZrD/V27Zj0JngW5xg1DFz42G0uDYl2XhzF6alSzD62w==", + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.2.tgz", + "integrity": "sha512-rtPMlmcO4agTUfz10CbgJ1k6UAoXM2gWb3GoMPPZB/+/Ackf8lNWk11K4rYi2D0apgoFRLtQOZhb+/iGNJq26A==", "dev": true, "optional": true }, @@ -436,11 +445,27 @@ "dev": true }, "validator": { - "version": "12.2.0", - "resolved": "https://registry.npmjs.org/validator/-/validator-12.2.0.tgz", - "integrity": "sha512-jJfE/DW6tIK1Ek8nCfNFqt8Wb3nzMoAbocBF6/Icgg1ZFSBpObdnwVY2jQj6qUqzhx5jc71fpvBWyLGO7Xl+nQ==", + "version": "13.6.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.6.0.tgz", + "integrity": "sha512-gVgKbdbHgtxpRyR8K0O6oFZPhhB5tT1jeEHZR0Znr9Svg03U0+r9DXWMrnRAB+HtCStDQKlaIZm42tVsVjqtjg==", + "dev": true + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=", "dev": true }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "dev": true, + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", @@ -465,9 +490,9 @@ } }, "y18n": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", - "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", "dev": true }, "yargs": { @@ -500,15 +525,15 @@ } }, "z-schema": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/z-schema/-/z-schema-4.2.3.tgz", - "integrity": "sha512-zkvK/9TC6p38IwcrbnT3ul9in1UX4cm1y/VZSs4GHKIiDCrlafc+YQBgQBUdDXLAoZHf2qvQ7gJJOo6yT1LH6A==", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/z-schema/-/z-schema-4.2.4.tgz", + "integrity": "sha512-YvBeW5RGNeNzKOUJs3rTL4+9rpcvHXt5I051FJbOcitV8bl40pEfcG0Q+dWSwS0/BIYrMZ/9HHoqLllMkFhD0w==", "dev": true, "requires": { "commander": "^2.7.1", "lodash.get": "^4.4.2", "lodash.isequal": "^4.5.0", - "validator": "^12.0.0" + "validator": "^13.6.0" } } } diff --git a/openapi/package.json b/openapi/package.json index 5c95b3a87..7e8288c86 100644 --- a/openapi/package.json +++ b/openapi/package.json @@ -14,7 +14,7 @@ }, "homepage": "https://github.com/okta/oktasdk-sdk-dotnet#readme", "devDependencies": { - "@okta/openapi": "^2.3.0", + "@okta/openapi": "^2.7.1", "json-stable-stringify": "^1.0.1", "lodash": "^4.17.21" } diff --git a/src/Okta.Sdk.IntegrationTests/AuthenticatorScenarios.cs b/src/Okta.Sdk.IntegrationTests/AuthenticatorScenarios.cs new file mode 100644 index 000000000..6c610844a --- /dev/null +++ b/src/Okta.Sdk.IntegrationTests/AuthenticatorScenarios.cs @@ -0,0 +1,47 @@ +// +// Copyright (c) 2020 - present 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.Threading.Tasks; +using FluentAssertions; +using FluentAssertions.Extensions; +using Xunit; + +namespace Okta.Sdk.IntegrationTests +{ + public class AuthenticatorScenarios + { + [Fact] + public async Task ListAuthenticatorsAsync() + { + var client = TestClient.Create(); + + var authenticators = await client.Authenticators.ListAuthenticators().ToListAsync(); + + authenticators.Should().NotBeNullOrEmpty(); + authenticators.Select(x => x.Type.ToString()).Should().BeSubsetOf(new List { "app", "password", "security_question", "phone", "email", "security_key" }); + } + + [Fact] + public async Task GetAuthenticatorByIdAsync() + { + var client = TestClient.Create(); + + var authenticators = await client.Authenticators.ListAuthenticators().ToListAsync(); + // Password should be enabled + var passwordAuthenticator = authenticators.FirstOrDefault(x => x.Type == AuthenticatorType.Password); + + var retrievedAuthenticator = await client.Authenticators.GetAuthenticatorAsync(passwordAuthenticator.Id); + + retrievedAuthenticator.Key.Should().Be(passwordAuthenticator.Key); + retrievedAuthenticator.Name.Should().Be(passwordAuthenticator.Name); + retrievedAuthenticator.Status.Should().Be(passwordAuthenticator.Status); + retrievedAuthenticator.Created.Should().Be(passwordAuthenticator.Created); + retrievedAuthenticator.Settings.Should().Be(passwordAuthenticator.Settings); + } + } +} diff --git a/src/Okta.Sdk.IntegrationTests/GroupSchemaScenarios.cs b/src/Okta.Sdk.IntegrationTests/GroupSchemaScenarios.cs new file mode 100644 index 000000000..af2de8636 --- /dev/null +++ b/src/Okta.Sdk.IntegrationTests/GroupSchemaScenarios.cs @@ -0,0 +1,79 @@ +// +// Copyright (c) 2020 - present 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.Threading.Tasks; +using FluentAssertions; +using Xunit; + +namespace Okta.Sdk.IntegrationTests +{ + public class GroupSchemaScenarios + { + [Fact] + public async Task GetGroupSchemaAsync() + { + var client = TestClient.Create(); + + var groupSchema = await client.GroupSchemas.GetGroupSchemaAsync(); + groupSchema.Should().NotBeNull(); + groupSchema.Schema.Should().Be("http://json-schema.org/draft-04/schema#"); + groupSchema.Definitions?.Base?.Id.Should().Be("#base"); + groupSchema.Definitions?.Custom?.Id.Should().Be("#custom"); + groupSchema.Name.Should().Be("group"); + } + + [Fact(Skip = "Depends on OKTA-431664")] + public async Task UpdatePropertyToGroupSchemaAsync() + { + var client = TestClient.Create(); + + var groupSchema = await client.GroupSchemas.GetGroupSchemaAsync(); + var guid = Guid.NewGuid(); + + // Add custom attribute + var customAttributeDetails = new GroupSchemaAttribute() + { + Title = "Group administrative contact", + Type = "string", + Description = guid.ToString(), + MinLength = 1, + MaxLength = 20, + Permissions = new List + { + new UserSchemaAttributePermission + { + Action = "READ_WRITE", + Principal = "SELF", + }, + }, + }; + + var customAttribute = new Resource(); + customAttribute["groupContact"] = customAttributeDetails; + groupSchema.Definitions.Custom.Properties = customAttribute; + + var updatedGroupSchema = await client.GroupSchemas.UpdateGroupSchemaAsync(groupSchema); + + var retrievedCustomAttribute = updatedGroupSchema.Definitions.Custom.Properties.GetProperty("groupContact"); + retrievedCustomAttribute.Title.Should().Be("Group administrative contact"); + retrievedCustomAttribute.Type.Should().Be(UserSchemaAttributeType.String); + retrievedCustomAttribute.Description.Should().Be(guid.ToString()); + retrievedCustomAttribute.Required.Should().BeNull(); + retrievedCustomAttribute.MinLength.Should().Be(1); + retrievedCustomAttribute.MaxLength.Should().Be(20); + retrievedCustomAttribute.Permissions.FirstOrDefault().Principal.Should().Be("SELF"); + retrievedCustomAttribute.Permissions.FirstOrDefault().Action.Should().Be("READ_WRITE"); + + // Remove custom attribute + customAttribute["groupContact"] = null; + updatedGroupSchema.Definitions.Custom.Properties = customAttribute; + updatedGroupSchema = await client.GroupSchemas.UpdateGroupSchemaAsync(updatedGroupSchema); + updatedGroupSchema.Definitions.Custom.Properties.GetProperty("groupContact").Should().BeNull(); + } + } +} diff --git a/src/Okta.Sdk.IntegrationTests/OrgScenarios.cs b/src/Okta.Sdk.IntegrationTests/OrgScenarios.cs new file mode 100644 index 000000000..ff7a05016 --- /dev/null +++ b/src/Okta.Sdk.IntegrationTests/OrgScenarios.cs @@ -0,0 +1,257 @@ +// +// Copyright (c) 2020 - present 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.Threading.Tasks; +using FluentAssertions; +using FluentAssertions.Extensions; +using Xunit; + +namespace Okta.Sdk.IntegrationTests +{ + public class OrgScenarios + { + [Fact] + public async Task UpdateOrgSettings() + { + var client = TestClient.Create(); + var guid = Guid.NewGuid(); + + var orgSettings = await client.Orgs.GetOrgSettingsAsync(); + + orgSettings.PhoneNumber = "+1-555-415-1337"; + orgSettings.Address1 = "301 Brannan St."; + orgSettings.Address2 = guid.ToString(); + + IOrgSetting updatedOrgSettings = null; + + try + { + updatedOrgSettings = await client.Orgs.UpdateOrgSettingAsync(orgSettings); + updatedOrgSettings.PhoneNumber.Should().Be("+1-555-415-1337"); + updatedOrgSettings.Address1.Should().Be("301 Brannan St."); + updatedOrgSettings.Address2.Should().Be(guid.ToString()); + + } + finally + { + updatedOrgSettings.PhoneNumber = string.Empty; + updatedOrgSettings.Address1 = string.Empty; + updatedOrgSettings.Address2 = string.Empty; + await client.Orgs.UpdateOrgSettingAsync(updatedOrgSettings); + } + } + + [Fact] + public async Task GetOrgSettingsAsync() + { + var client = TestClient.Create(); + + var orgSettings = await client.Orgs.GetOrgSettingsAsync(); + + orgSettings.Should().NotBeNull(); + orgSettings.Id.Should().NotBeNullOrEmpty(); + } + + [Fact] + public async Task GetOrgContactTypesAsync() + { + var client = TestClient.Create(); + + var orgContactTypes = await client.Orgs.GetOrgContactTypes().ToListAsync(); + + orgContactTypes.Should().NotBeNullOrEmpty(); + orgContactTypes.Select(x => x.ContactType == OrgContactType.Billing).Should().NotBeNullOrEmpty(); + orgContactTypes.Select(x => x.ContactType == OrgContactType.Technical).Should().NotBeNullOrEmpty(); + } + + [Fact] + public async Task UpdateOrgContactTypeUserAsync() + { + var client = TestClient.Create(); + var guid = Guid.NewGuid(); + + // Create a user + var user = await client.Users.CreateUserAsync(new CreateUserWithPasswordOptions + { + Profile = new UserProfile + { + FirstName = "John", + LastName = "Update-Contact-Type", + Email = $"john-org-contact-{guid}@example.com", + Login = $"john-org-contact-{guid}@example.com", + }, + Password = "P4ssw0rd", + }); + + try + { + var orgContactUser = await client.Orgs.UpdateOrgContactUserAsync( + new UserIdString + { + UserId = user.Id, + }, OrgContactType.Technical); + + orgContactUser.UserId.Should().Be(user.Id); + } + finally + { + // Reset + await client.Orgs.UpdateOrgContactUserAsync( + new UserIdString + { + UserId = null, + }, OrgContactType.Technical); + + // Remove the user + await user.DeactivateAsync(); + await user.DeactivateOrDeleteAsync(); + } + } + + [Fact] + public async Task GetOktaSupportSettingsAsync() + { + var client = TestClient.Create(); + + var orgSupportSettings = await client.Orgs.GetOrgOktaSupportSettingsAsync(); + orgSupportSettings.Should().NotBeNull(); + orgSupportSettings.Support?.Value.Should().ContainAny(OrgOktaSupportSetting.Disabled, OrgOktaSupportSetting.Enabled); + } + + [Fact] + public async Task GrantOktaSupportAsync() + { + var client = TestClient.Create(); + try + { + var orgSupportSettings = await client.Orgs.GrantOktaSupportAsync(); + orgSupportSettings.Should().NotBeNull(); + orgSupportSettings.Support.Should().Be(OrgOktaSupportSetting.Enabled); + // Expiration should be in 8 hours + orgSupportSettings.Expiration.Value.UtcDateTime.TimeOfDay.Should().BeLessThan(DateTimeOffset.UtcNow.AddHours(8).TimeOfDay); + } + finally + { + await client.Orgs.RevokeOktaSupportAsync(); + } + } + + [Fact] + public async Task ExtendOktaSupportAsync() + { + var client = TestClient.Create(); + try + { + var orgSupportSettings = await client.Orgs.GrantOktaSupportAsync(); + orgSupportSettings.Should().NotBeNull(); + orgSupportSettings.Support.Should().Be(OrgOktaSupportSetting.Enabled); + var initialExpirationValue = orgSupportSettings.Expiration.Value; + // Expiration should be in 8 hours + orgSupportSettings.Expiration.Value.UtcDateTime.TimeOfDay.Should().BeLessThan(DateTimeOffset.UtcNow.AddHours(8).TimeOfDay); + + var updatedSupportSettings = await client.Orgs.ExtendOktaSupportAsync(); + updatedSupportSettings.Support.Should().Be(OrgOktaSupportSetting.Enabled); + (updatedSupportSettings.Expiration.Value > initialExpirationValue).Should().BeTrue(); + } + finally + { + await client.Orgs.RevokeOktaSupportAsync(); + } + } + + [Fact] + public async Task RevokeOktaSupportAsync() + { + var client = TestClient.Create(); + try + { + var orgSupportSettings = await client.Orgs.GrantOktaSupportAsync(); + orgSupportSettings.Should().NotBeNull(); + orgSupportSettings.Support.Should().Be(OrgOktaSupportSetting.Enabled); + + orgSupportSettings = await client.Orgs.RevokeOktaSupportAsync(); + orgSupportSettings.Support.Should().Be(OrgOktaSupportSetting.Disabled); + } + finally + { + await client.Orgs.RevokeOktaSupportAsync(); + } + } + + [Fact] + public async Task GetOktaCommunicationSettingsAsync() + { + var client = TestClient.Create(); + var orgCommunicationSettings = await client.Orgs.GetOktaCommunicationSettingsAsync(); + orgCommunicationSettings.Should().NotBeNull(); + } + + [Fact] + public async Task OptInEmailUsersAsync() + { + var client = TestClient.Create(); + try + { + var orgCommunicationSettings = await client.Orgs.OptInUsersToOktaCommunicationEmailsAsync(); + orgCommunicationSettings.OptOutEmailUsers.Should().BeFalse(); + } + finally + { + await client.Orgs.OptOutUsersFromOktaCommunicationEmailsAsync(); + } + } + + [Fact] + public async Task OptOutEmailUsersAsync() + { + var client = TestClient.Create(); + try + { + var orgCommunicationSettings = await client.Orgs.OptOutUsersFromOktaCommunicationEmailsAsync(); + orgCommunicationSettings.OptOutEmailUsers.Should().BeTrue(); + } + finally + { + await client.Orgs.OptOutUsersFromOktaCommunicationEmailsAsync(); + } + } + + [Fact] + public async Task GetOrgPreferencesAsync() + { + var client = TestClient.Create(); + var orgPreferences = await client.Orgs.GetOrgPreferencesAsync(); + orgPreferences.Should().NotBeNull(); + } + + [Fact] + public async Task ShowEndUserFooterAsync() + { + var client = TestClient.Create(); + + var orgPreferences = await client.Orgs.ShowOktaUiFooterAsync(); + orgPreferences.ShowEndUserFooter.Should().BeTrue(); + } + + [Fact] + public async Task HideEndUserFooterAsync() + { + var client = TestClient.Create(); + + try + { + var orgPreferences = await client.Orgs.HideOktaUiFooterAsync(); + orgPreferences.ShowEndUserFooter.Should().BeFalse(); + } + finally + { + var orgPreferences = await client.Orgs.ShowOktaUiFooterAsync(); + } + } + } +} diff --git a/src/Okta.Sdk.IntegrationTests/PoliciesScenarios.cs b/src/Okta.Sdk.IntegrationTests/PoliciesScenarios.cs index f7cdfc513..caaa0e03d 100644 --- a/src/Okta.Sdk.IntegrationTests/PoliciesScenarios.cs +++ b/src/Okta.Sdk.IntegrationTests/PoliciesScenarios.cs @@ -483,7 +483,7 @@ public async Task CreateOktaSignOnOnPremPolicyRule() } } - [Fact] + [Fact(Skip = "Depends on OKTA-431665")] public async Task CreateOktaSignOnRadiusPolicyRule() { var client = TestClient.Create(); diff --git a/src/Okta.Sdk.IntegrationTests/UserScenarios.cs b/src/Okta.Sdk.IntegrationTests/UserScenarios.cs index d35158505..490c35ef7 100644 --- a/src/Okta.Sdk.IntegrationTests/UserScenarios.cs +++ b/src/Okta.Sdk.IntegrationTests/UserScenarios.cs @@ -680,6 +680,8 @@ await createdUser.AssignRoleAsync( Type = RoleType.OrgAdmin, }); + Thread.Sleep(2000); + var roles = await createdUser.Roles.ToListAsync(); roles.Count.Should().Be(2); diff --git a/src/Okta.Sdk.IntegrationTests/UserSchemaScenarios.cs b/src/Okta.Sdk.IntegrationTests/UserSchemaScenarios.cs index 0c5a0640a..3e5fafe29 100644 --- a/src/Okta.Sdk.IntegrationTests/UserSchemaScenarios.cs +++ b/src/Okta.Sdk.IntegrationTests/UserSchemaScenarios.cs @@ -40,7 +40,7 @@ public async Task GetUserSchema() userSchema.Definitions.Base.Required.Should().Contain("login"); } - [Fact] + [Fact(Skip = "Depends on OKTA-431664")] public async Task UpdateUserProfileSchemaProperty() { var testClient = TestClient.Create(); diff --git a/src/Okta.Sdk.UnitTests/AuthenticatorClientShould.cs b/src/Okta.Sdk.UnitTests/AuthenticatorClientShould.cs new file mode 100644 index 000000000..49eff110c --- /dev/null +++ b/src/Okta.Sdk.UnitTests/AuthenticatorClientShould.cs @@ -0,0 +1,125 @@ +// +// Copyright (c) 2020 - present 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.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using FluentAssertions; +using NSubstitute; +using Okta.Sdk.Internal; +using Okta.Sdk.UnitTests.Internal; +using Xunit; + +namespace Okta.Sdk.UnitTests +{ + public class AuthenticatorClientShould + { + [Fact] + public async Task ActivateAuthenticatorAsync() + { + var rawResponse = @"{ + ""type"": ""security_key"", + ""id"": ""aut1nd8PQhGcQtSxB0g4"", + ""key"": ""webauthn"", + ""status"": ""ACTIVE"", + ""name"": ""Security Key or Biometric"", + ""created"": ""2020-07-26T21:16:37.000Z"", + ""lastUpdated"": ""2020-07-26T21:59:33.000Z"", + ""_links"": { + ""self"": { + ""href"": ""https://${yourOktaDomain}/api/v1/authenticators/aut1nd8PQhGcQtSxB0g4"", + ""hints"": { + ""allow"": [ + ""GET"", + ""PUT"" + ] + } + }, + ""methods"": { + ""href"": ""https://${yourOktaDomain}/api/v1/authenticators/aut1nd8PQhGcQtSxB0g4/methods"", + ""hints"": { + ""allow"": [ + ""GET"" + ] + } + }, + ""deactivate"": { + ""href"": ""https://${yourOktaDomain}/api/v1/authenticators/aut1nd8PQhGcQtSxB0g4/lifecycle/deactivate"", + ""hints"": { + ""allow"": [ + ""POST"" + ] + } + } + } + }"; + + var mockRequestExecutor = new MockedStringRequestExecutor(rawResponse); + var client = new TestableOktaClient(mockRequestExecutor); + + var authenticator = await client.Authenticators.ActivateAuthenticatorAsync("aut1nd8PQhGcQtSxB0g4"); + authenticator.Id.Should().Be("aut1nd8PQhGcQtSxB0g4"); + authenticator.Status.Should().Be(AuthenticatorStatus.Active); + authenticator.Key.Should().Be("webauthn"); + authenticator.Name.Should().Be("Security Key or Biometric"); + + mockRequestExecutor.ReceivedHref.Should().Be("/api/v1/authenticators/aut1nd8PQhGcQtSxB0g4/lifecycle/activate"); + } + + [Fact] + public async Task DeactivateAuthenticatorAsync() + { + var rawResponse = @"{ + ""type"": ""security_key"", + ""id"": ""aut1nd8PQhGcQtSxB0g4"", + ""key"": ""webauthn"", + ""status"": ""INACTIVE"", + ""name"": ""Security Key or Biometric"", + ""created"": ""2020-07-26T21:16:37.000Z"", + ""lastUpdated"": ""2020-07-26T21:59:33.000Z"", + ""_links"": { + ""self"": { + ""href"": ""https://${yourOktaDomain}/api/v1/authenticators/aut1nd8PQhGcQtSxB0g4"", + ""hints"": { + ""allow"": [ + ""GET"", + ""PUT"" + ] + } + }, + ""methods"": { + ""href"": ""https://${yourOktaDomain}/api/v1/authenticators/aut1nd8PQhGcQtSxB0g4/methods"", + ""hints"": { + ""allow"": [ + ""GET"" + ] + } + }, + ""deactivate"": { + ""href"": ""https://${yourOktaDomain}/api/v1/authenticators/aut1nd8PQhGcQtSxB0g4/lifecycle/deactivate"", + ""hints"": { + ""allow"": [ + ""POST"" + ] + } + } + } + }"; + + var mockRequestExecutor = new MockedStringRequestExecutor(rawResponse); + var client = new TestableOktaClient(mockRequestExecutor); + + var authenticator = await client.Authenticators.DeactivateAuthenticatorAsync("aut1nd8PQhGcQtSxB0g4"); + authenticator.Id.Should().Be("aut1nd8PQhGcQtSxB0g4"); + authenticator.Status.Should().Be(AuthenticatorStatus.Inactive); + authenticator.Key.Should().Be("webauthn"); + authenticator.Name.Should().Be("Security Key or Biometric"); + + mockRequestExecutor.ReceivedHref.Should().Be("/api/v1/authenticators/aut1nd8PQhGcQtSxB0g4/lifecycle/deactivate"); + } + } +} diff --git a/src/Okta.Sdk/Generated/AllowedForEnum.Generated.cs b/src/Okta.Sdk/Generated/AllowedForEnum.Generated.cs new file mode 100644 index 000000000..499832244 --- /dev/null +++ b/src/Okta.Sdk/Generated/AllowedForEnum.Generated.cs @@ -0,0 +1,43 @@ +// +// Copyright (c) 2014 - present 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 AllowedForEnum values in the Okta API. + /// + public sealed class AllowedForEnum : StringEnum + { + /// The recovery AllowedForEnum. + public static AllowedForEnum Recovery = new AllowedForEnum("recovery"); + + /// The sso AllowedForEnum. + public static AllowedForEnum Sso = new AllowedForEnum("sso"); + + /// The any AllowedForEnum. + public static AllowedForEnum Any = new AllowedForEnum("any"); + + /// The none AllowedForEnum. + public static AllowedForEnum None = new AllowedForEnum("none"); + + /// + /// Implicit operator declaration to accept and convert a string value as a + /// + /// The value to use + public static implicit operator AllowedForEnum(string value) => new AllowedForEnum(value); + + /// + /// Creates a new instance. + /// + /// The value to use. + public AllowedForEnum(string value) + : base(value) + { + } + + } +} diff --git a/src/Okta.Sdk/Generated/Authenticator.Generated.cs b/src/Okta.Sdk/Generated/Authenticator.Generated.cs new file mode 100644 index 000000000..dba0c7400 --- /dev/null +++ b/src/Okta.Sdk/Generated/Authenticator.Generated.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) 2014 - present 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 Authenticator : Resource, IAuthenticator + { + /// + public DateTimeOffset? Created => GetDateTimeProperty("created"); + + /// + public string Id => GetStringProperty("id"); + + /// + public string Key + { + get => GetStringProperty("key"); + set => this["key"] = value; + } + + /// + public DateTimeOffset? LastUpdated => GetDateTimeProperty("lastUpdated"); + + /// + public string Name + { + get => GetStringProperty("name"); + set => this["name"] = value; + } + + /// + public IAuthenticatorSettings Settings + { + get => GetResourceProperty("settings"); + set => this["settings"] = value; + } + + /// + public AuthenticatorStatus Status + { + get => GetEnumProperty("status"); + set => this["status"] = value; + } + + /// + public AuthenticatorType Type + { + get => GetEnumProperty("type"); + set => this["type"] = value; + } + + /// + public Task ActivateAsync( + CancellationToken cancellationToken = default(CancellationToken)) + => GetClient().Authenticators.ActivateAuthenticatorAsync(Id, cancellationToken); + + /// + public Task DeactivateAsync( + CancellationToken cancellationToken = default(CancellationToken)) + => GetClient().Authenticators.DeactivateAuthenticatorAsync(Id, cancellationToken); + + } +} diff --git a/src/Okta.Sdk/Generated/AuthenticatorSettings.Generated.cs b/src/Okta.Sdk/Generated/AuthenticatorSettings.Generated.cs new file mode 100644 index 000000000..a6817e218 --- /dev/null +++ b/src/Okta.Sdk/Generated/AuthenticatorSettings.Generated.cs @@ -0,0 +1,34 @@ +// +// Copyright (c) 2014 - present 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 AuthenticatorSettings : Resource, IAuthenticatorSettings + { + /// + public AllowedForEnum AllowedFor + { + get => GetEnumProperty("allowedFor"); + set => this["allowedFor"] = value; + } + + /// + public int? TokenLifetimeInMinutes + { + get => GetIntegerProperty("tokenLifetimeInMinutes"); + set => this["tokenLifetimeInMinutes"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/AuthenticatorStatus.Generated.cs b/src/Okta.Sdk/Generated/AuthenticatorStatus.Generated.cs new file mode 100644 index 000000000..c74c177eb --- /dev/null +++ b/src/Okta.Sdk/Generated/AuthenticatorStatus.Generated.cs @@ -0,0 +1,37 @@ +// +// Copyright (c) 2014 - present 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 AuthenticatorStatus values in the Okta API. + /// + public sealed class AuthenticatorStatus : StringEnum + { + /// The ACTIVE AuthenticatorStatus. + public static AuthenticatorStatus Active = new AuthenticatorStatus("ACTIVE"); + + /// The INACTIVE AuthenticatorStatus. + public static AuthenticatorStatus Inactive = new AuthenticatorStatus("INACTIVE"); + + /// + /// Implicit operator declaration to accept and convert a string value as a + /// + /// The value to use + public static implicit operator AuthenticatorStatus(string value) => new AuthenticatorStatus(value); + + /// + /// Creates a new instance. + /// + /// The value to use. + public AuthenticatorStatus(string value) + : base(value) + { + } + + } +} diff --git a/src/Okta.Sdk/Generated/AuthenticatorType.Generated.cs b/src/Okta.Sdk/Generated/AuthenticatorType.Generated.cs new file mode 100644 index 000000000..8bd4bd287 --- /dev/null +++ b/src/Okta.Sdk/Generated/AuthenticatorType.Generated.cs @@ -0,0 +1,49 @@ +// +// Copyright (c) 2014 - present 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 AuthenticatorType values in the Okta API. + /// + public sealed class AuthenticatorType : StringEnum + { + /// The app AuthenticatorType. + public static AuthenticatorType App = new AuthenticatorType("app"); + + /// The password AuthenticatorType. + public static AuthenticatorType Password = new AuthenticatorType("password"); + + /// The security_question AuthenticatorType. + public static AuthenticatorType SecurityQuestion = new AuthenticatorType("security_question"); + + /// The phone AuthenticatorType. + public static AuthenticatorType Phone = new AuthenticatorType("phone"); + + /// The email AuthenticatorType. + public static AuthenticatorType Email = new AuthenticatorType("email"); + + /// The security_key AuthenticatorType. + public static AuthenticatorType SecurityKey = new AuthenticatorType("security_key"); + + /// + /// Implicit operator declaration to accept and convert a string value as a + /// + /// The value to use + public static implicit operator AuthenticatorType(string value) => new AuthenticatorType(value); + + /// + /// Creates a new instance. + /// + /// The value to use. + public AuthenticatorType(string value) + : base(value) + { + } + + } +} diff --git a/src/Okta.Sdk/Generated/AuthenticatorsClient.Generated.cs b/src/Okta.Sdk/Generated/AuthenticatorsClient.Generated.cs new file mode 100644 index 000000000..192f5ac52 --- /dev/null +++ b/src/Okta.Sdk/Generated/AuthenticatorsClient.Generated.cs @@ -0,0 +1,80 @@ +// +// Copyright (c) 2014 - present 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 AuthenticatorsClient : OktaClient, IAuthenticatorsClient + { + // Remove parameterless constructor + private AuthenticatorsClient() + { + } + + internal AuthenticatorsClient(IDataStore dataStore, OktaClientConfiguration configuration, RequestContext requestContext) + : base(dataStore, configuration, requestContext) + { + } + + /// + public ICollectionClient ListAuthenticators() + => GetCollectionClient(new HttpRequest + { + Uri = "/api/v1/authenticators", + Verb = HttpVerb.Get, + + }); + + /// + public async Task GetAuthenticatorAsync(string authenticatorId, CancellationToken cancellationToken = default(CancellationToken)) + => await GetAsync(new HttpRequest + { + Uri = "/api/v1/authenticators/{authenticatorId}", + Verb = HttpVerb.Get, + + PathParameters = new Dictionary() + { + ["authenticatorId"] = authenticatorId, + }, + }, cancellationToken).ConfigureAwait(false); + + /// + public async Task ActivateAuthenticatorAsync(string authenticatorId, CancellationToken cancellationToken = default(CancellationToken)) + => await PostAsync(new HttpRequest + { + Uri = "/api/v1/authenticators/{authenticatorId}/lifecycle/activate", + Verb = HttpVerb.Post, + + PathParameters = new Dictionary() + { + ["authenticatorId"] = authenticatorId, + }, + }, cancellationToken).ConfigureAwait(false); + + /// + public async Task DeactivateAuthenticatorAsync(string authenticatorId, CancellationToken cancellationToken = default(CancellationToken)) + => await PostAsync(new HttpRequest + { + Uri = "/api/v1/authenticators/{authenticatorId}/lifecycle/deactivate", + Verb = HttpVerb.Post, + + PathParameters = new Dictionary() + { + ["authenticatorId"] = authenticatorId, + }, + }, cancellationToken).ConfigureAwait(false); + + } +} diff --git a/src/Okta.Sdk/Generated/GroupSchema.Generated.cs b/src/Okta.Sdk/Generated/GroupSchema.Generated.cs new file mode 100644 index 000000000..9e893a900 --- /dev/null +++ b/src/Okta.Sdk/Generated/GroupSchema.Generated.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) 2014 - present 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 +{ + /// + [ResourceObject(NullValueHandling = ResourceNullValueHandling.Include)] + public sealed partial class GroupSchema : Resource, IGroupSchema + + { + /// + public string Schema => GetStringProperty("$schema"); + + /// + public string Created => GetStringProperty("created"); + + /// + public IGroupSchemaDefinitions Definitions + { + get => GetResourceProperty("definitions"); + set => this["definitions"] = value; + } + + /// + public string Description + { + get => GetStringProperty("description"); + set => this["description"] = value; + } + + /// + public string Id => GetStringProperty("id"); + + /// + public string LastUpdated => GetStringProperty("lastUpdated"); + + /// + public string Name => GetStringProperty("name"); + + /// + public IUserSchemaProperties Properties => GetResourceProperty("properties"); + + /// + public string Title + { + get => GetStringProperty("title"); + set => this["title"] = value; + } + + /// + public string Type => GetStringProperty("type"); + + } +} diff --git a/src/Okta.Sdk/Generated/GroupSchemaAttribute.Generated.cs b/src/Okta.Sdk/Generated/GroupSchemaAttribute.Generated.cs new file mode 100644 index 000000000..877d61cff --- /dev/null +++ b/src/Okta.Sdk/Generated/GroupSchemaAttribute.Generated.cs @@ -0,0 +1,139 @@ +// +// Copyright (c) 2014 - present 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 GroupSchemaAttribute : Resource, IGroupSchemaAttribute + { + /// + public string Description + { + get => GetStringProperty("description"); + set => this["description"] = value; + } + + /// + public IList Enum + { + get => GetArrayProperty("enum"); + set => this["enum"] = value; + } + + /// + public string ExternalName + { + get => GetStringProperty("externalName"); + set => this["externalName"] = value; + } + + /// + public string ExternalNamespace + { + get => GetStringProperty("externalNamespace"); + set => this["externalNamespace"] = value; + } + + /// + public IUserSchemaAttributeItems Items + { + get => GetResourceProperty("items"); + set => this["items"] = value; + } + + /// + public IUserSchemaAttributeMaster Master + { + get => GetResourceProperty("master"); + set => this["master"] = value; + } + + /// + public int? MaxLength + { + get => GetIntegerProperty("maxLength"); + set => this["maxLength"] = value; + } + + /// + public int? MinLength + { + get => GetIntegerProperty("minLength"); + set => this["minLength"] = value; + } + + /// + public string Mutability + { + get => GetStringProperty("mutability"); + set => this["mutability"] = value; + } + + /// + public IList OneOf + { + get => GetArrayProperty("oneOf"); + set => this["oneOf"] = value; + } + + /// + public IList Permissions + { + get => GetArrayProperty("permissions"); + set => this["permissions"] = value; + } + + /// + public bool? Required + { + get => GetBooleanProperty("required"); + set => this["required"] = value; + } + + /// + public UserSchemaAttributeScope Scope + { + get => GetEnumProperty("scope"); + set => this["scope"] = value; + } + + /// + public string Title + { + get => GetStringProperty("title"); + set => this["title"] = value; + } + + /// + public UserSchemaAttributeType Type + { + get => GetEnumProperty("type"); + set => this["type"] = value; + } + + /// + public UserSchemaAttributeUnion Union + { + get => GetEnumProperty("union"); + set => this["union"] = value; + } + + /// + public string Unique + { + get => GetStringProperty("unique"); + set => this["unique"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/GroupSchemaBase.Generated.cs b/src/Okta.Sdk/Generated/GroupSchemaBase.Generated.cs new file mode 100644 index 000000000..10a310d58 --- /dev/null +++ b/src/Okta.Sdk/Generated/GroupSchemaBase.Generated.cs @@ -0,0 +1,44 @@ +// +// Copyright (c) 2014 - present 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 GroupSchemaBase : Resource, IGroupSchemaBase + { + /// + public string Id => GetStringProperty("id"); + + /// + public IGroupSchemaBaseProperties Properties + { + get => GetResourceProperty("properties"); + set => this["properties"] = value; + } + + /// + public IList Required + { + get => GetArrayProperty("required"); + set => this["required"] = value; + } + + /// + public string Type + { + get => GetStringProperty("type"); + set => this["type"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/GroupSchemaBaseProperties.Generated.cs b/src/Okta.Sdk/Generated/GroupSchemaBaseProperties.Generated.cs new file mode 100644 index 000000000..fc654552f --- /dev/null +++ b/src/Okta.Sdk/Generated/GroupSchemaBaseProperties.Generated.cs @@ -0,0 +1,34 @@ +// +// Copyright (c) 2014 - present 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 GroupSchemaBaseProperties : Resource, IGroupSchemaBaseProperties + { + /// + public IGroupSchemaAttribute Description + { + get => GetResourceProperty("description"); + set => this["description"] = value; + } + + /// + public IGroupSchemaAttribute Name + { + get => GetResourceProperty("name"); + set => this["name"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/GroupSchemaCustom.Generated.cs b/src/Okta.Sdk/Generated/GroupSchemaCustom.Generated.cs new file mode 100644 index 000000000..8016ae53d --- /dev/null +++ b/src/Okta.Sdk/Generated/GroupSchemaCustom.Generated.cs @@ -0,0 +1,44 @@ +// +// Copyright (c) 2014 - present 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 GroupSchemaCustom : Resource, IGroupSchemaCustom + { + /// + public string Id => GetStringProperty("id"); + + /// + public Resource Properties + { + get => GetResourceProperty("properties"); + set => this["properties"] = value; + } + + /// + public IList Required + { + get => GetArrayProperty("required"); + set => this["required"] = value; + } + + /// + public string Type + { + get => GetStringProperty("type"); + set => this["type"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/GroupSchemaDefinitions.Generated.cs b/src/Okta.Sdk/Generated/GroupSchemaDefinitions.Generated.cs new file mode 100644 index 000000000..b8d2568a9 --- /dev/null +++ b/src/Okta.Sdk/Generated/GroupSchemaDefinitions.Generated.cs @@ -0,0 +1,34 @@ +// +// Copyright (c) 2014 - present 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 GroupSchemaDefinitions : Resource, IGroupSchemaDefinitions + { + /// + public IGroupSchemaBase Base + { + get => GetResourceProperty("base"); + set => this["base"] = value; + } + + /// + public IGroupSchemaCustom Custom + { + get => GetResourceProperty("custom"); + set => this["custom"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/GroupSchemasClient.Generated.cs b/src/Okta.Sdk/Generated/GroupSchemasClient.Generated.cs new file mode 100644 index 000000000..8a6b368c1 --- /dev/null +++ b/src/Okta.Sdk/Generated/GroupSchemasClient.Generated.cs @@ -0,0 +1,50 @@ +// +// Copyright (c) 2014 - present 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 GroupSchemasClient : OktaClient, IGroupSchemasClient + { + // Remove parameterless constructor + private GroupSchemasClient() + { + } + + internal GroupSchemasClient(IDataStore dataStore, OktaClientConfiguration configuration, RequestContext requestContext) + : base(dataStore, configuration, requestContext) + { + } + + /// + public async Task GetGroupSchemaAsync(CancellationToken cancellationToken = default(CancellationToken)) + => await GetAsync(new HttpRequest + { + Uri = "/api/v1/meta/schemas/group/default", + Verb = HttpVerb.Get, + + }, cancellationToken).ConfigureAwait(false); + + /// + public async Task UpdateGroupSchemaAsync(IGroupSchema body, CancellationToken cancellationToken = default(CancellationToken)) + => await PostAsync(new HttpRequest + { + Uri = "/api/v1/meta/schemas/group/default", + Verb = HttpVerb.Post, + Payload = body, + }, cancellationToken).ConfigureAwait(false); + + } +} diff --git a/src/Okta.Sdk/Generated/IAuthenticator.Generated.cs b/src/Okta.Sdk/Generated/IAuthenticator.Generated.cs new file mode 100644 index 000000000..f3cd5c071 --- /dev/null +++ b/src/Okta.Sdk/Generated/IAuthenticator.Generated.cs @@ -0,0 +1,41 @@ +// +// Copyright (c) 2014 - present 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 Authenticator resource in the Okta API. + public partial interface IAuthenticator : IResource + { + DateTimeOffset? Created { get; } + + string Id { get; } + + string Key { get; set; } + + DateTimeOffset? LastUpdated { get; } + + string Name { get; set; } + + IAuthenticatorSettings Settings { get; set; } + + AuthenticatorStatus Status { get; set; } + + AuthenticatorType Type { get; set; } + + Task ActivateAsync( + CancellationToken cancellationToken = default(CancellationToken)); + + Task DeactivateAsync( + CancellationToken cancellationToken = default(CancellationToken)); + + } +} diff --git a/src/Okta.Sdk/Generated/IAuthenticatorSettings.Generated.cs b/src/Okta.Sdk/Generated/IAuthenticatorSettings.Generated.cs new file mode 100644 index 000000000..602910248 --- /dev/null +++ b/src/Okta.Sdk/Generated/IAuthenticatorSettings.Generated.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) 2014 - present 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 AuthenticatorSettings resource in the Okta API. + public partial interface IAuthenticatorSettings : IResource + { + AllowedForEnum AllowedFor { get; set; } + + int? TokenLifetimeInMinutes { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IAuthenticatorsClient.Generated.cs b/src/Okta.Sdk/Generated/IAuthenticatorsClient.Generated.cs new file mode 100644 index 000000000..e21e47f1f --- /dev/null +++ b/src/Okta.Sdk/Generated/IAuthenticatorsClient.Generated.cs @@ -0,0 +1,49 @@ +// +// Copyright (c) 2014 - present 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 +{ + /// A client that works with Okta Authenticator resources. + public partial interface IAuthenticatorsClient + { + /// + /// Success + /// + /// A collection of that can be enumerated asynchronously. + ICollectionClient ListAuthenticators(); + + /// + /// Success + /// + /// + /// The cancellation token. + /// The response. + Task GetAuthenticatorAsync(string authenticatorId, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Success + /// + /// + /// The cancellation token. + /// The response. + Task ActivateAuthenticatorAsync(string authenticatorId, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Success + /// + /// + /// The cancellation token. + /// The response. + Task DeactivateAuthenticatorAsync(string authenticatorId, CancellationToken cancellationToken = default(CancellationToken)); + + } +} diff --git a/src/Okta.Sdk/Generated/IGroupSchema.Generated.cs b/src/Okta.Sdk/Generated/IGroupSchema.Generated.cs new file mode 100644 index 000000000..332b0bdab --- /dev/null +++ b/src/Okta.Sdk/Generated/IGroupSchema.Generated.cs @@ -0,0 +1,39 @@ +// +// Copyright (c) 2014 - present 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 GroupSchema resource in the Okta API. + public partial interface IGroupSchema : IResource + { + string Schema { get; } + + string Created { get; } + + IGroupSchemaDefinitions Definitions { get; set; } + + string Description { get; set; } + + string Id { get; } + + string LastUpdated { get; } + + string Name { get; } + + IUserSchemaProperties Properties { get; } + + string Title { get; set; } + + string Type { get; } + + } +} diff --git a/src/Okta.Sdk/Generated/IGroupSchemaAttribute.Generated.cs b/src/Okta.Sdk/Generated/IGroupSchemaAttribute.Generated.cs new file mode 100644 index 000000000..59009bb10 --- /dev/null +++ b/src/Okta.Sdk/Generated/IGroupSchemaAttribute.Generated.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) 2014 - present 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 GroupSchemaAttribute resource in the Okta API. + public partial interface IGroupSchemaAttribute : IResource + { + string Description { get; set; } + + IList Enum { get; set; } + + string ExternalName { get; set; } + + string ExternalNamespace { get; set; } + + IUserSchemaAttributeItems Items { get; set; } + + IUserSchemaAttributeMaster Master { get; set; } + + int? MaxLength { get; set; } + + int? MinLength { get; set; } + + string Mutability { get; set; } + + IList OneOf { get; set; } + + IList Permissions { get; set; } + + bool? Required { get; set; } + + UserSchemaAttributeScope Scope { get; set; } + + string Title { get; set; } + + UserSchemaAttributeType Type { get; set; } + + UserSchemaAttributeUnion Union { get; set; } + + string Unique { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IGroupSchemaBase.Generated.cs b/src/Okta.Sdk/Generated/IGroupSchemaBase.Generated.cs new file mode 100644 index 000000000..c07c01db5 --- /dev/null +++ b/src/Okta.Sdk/Generated/IGroupSchemaBase.Generated.cs @@ -0,0 +1,27 @@ +// +// Copyright (c) 2014 - present 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 GroupSchemaBase resource in the Okta API. + public partial interface IGroupSchemaBase : IResource + { + string Id { get; } + + IGroupSchemaBaseProperties Properties { get; set; } + + IList Required { get; set; } + + string Type { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IGroupSchemaBaseProperties.Generated.cs b/src/Okta.Sdk/Generated/IGroupSchemaBaseProperties.Generated.cs new file mode 100644 index 000000000..511f12238 --- /dev/null +++ b/src/Okta.Sdk/Generated/IGroupSchemaBaseProperties.Generated.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) 2014 - present 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 GroupSchemaBaseProperties resource in the Okta API. + public partial interface IGroupSchemaBaseProperties : IResource + { + IGroupSchemaAttribute Description { get; set; } + + IGroupSchemaAttribute Name { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IGroupSchemaCustom.Generated.cs b/src/Okta.Sdk/Generated/IGroupSchemaCustom.Generated.cs new file mode 100644 index 000000000..e28f695d7 --- /dev/null +++ b/src/Okta.Sdk/Generated/IGroupSchemaCustom.Generated.cs @@ -0,0 +1,27 @@ +// +// Copyright (c) 2014 - present 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 GroupSchemaCustom resource in the Okta API. + public partial interface IGroupSchemaCustom : IResource + { + string Id { get; } + + Resource Properties { get; set; } + + IList Required { get; set; } + + string Type { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IGroupSchemaDefinitions.Generated.cs b/src/Okta.Sdk/Generated/IGroupSchemaDefinitions.Generated.cs new file mode 100644 index 000000000..005e811be --- /dev/null +++ b/src/Okta.Sdk/Generated/IGroupSchemaDefinitions.Generated.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) 2014 - present 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 GroupSchemaDefinitions resource in the Okta API. + public partial interface IGroupSchemaDefinitions : IResource + { + IGroupSchemaBase Base { get; set; } + + IGroupSchemaCustom Custom { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IGroupSchemasClient.Generated.cs b/src/Okta.Sdk/Generated/IGroupSchemasClient.Generated.cs new file mode 100644 index 000000000..8b744dfcc --- /dev/null +++ b/src/Okta.Sdk/Generated/IGroupSchemasClient.Generated.cs @@ -0,0 +1,34 @@ +// +// Copyright (c) 2014 - present 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 +{ + /// A client that works with Okta GroupSchema resources. + public partial interface IGroupSchemasClient + { + /// + /// Fetches the group schema + /// + /// The cancellation token. + /// The response. + Task GetGroupSchemaAsync(CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Updates, adds ore removes one or more custom Group Profile properties in the schema + /// + /// The resource. + /// The cancellation token. + /// The response. + Task UpdateGroupSchemaAsync(IGroupSchema body, CancellationToken cancellationToken = default(CancellationToken)); + + } +} diff --git a/src/Okta.Sdk/Generated/IOrgContactTypeObj.Generated.cs b/src/Okta.Sdk/Generated/IOrgContactTypeObj.Generated.cs new file mode 100644 index 000000000..6e2d8ed53 --- /dev/null +++ b/src/Okta.Sdk/Generated/IOrgContactTypeObj.Generated.cs @@ -0,0 +1,21 @@ +// +// Copyright (c) 2014 - present 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 OrgContactTypeObj resource in the Okta API. + public partial interface IOrgContactTypeObj : IResource + { + OrgContactType ContactType { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IOrgContactUser.Generated.cs b/src/Okta.Sdk/Generated/IOrgContactUser.Generated.cs new file mode 100644 index 000000000..0fbccdd97 --- /dev/null +++ b/src/Okta.Sdk/Generated/IOrgContactUser.Generated.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) 2014 - present 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 OrgContactUser resource in the Okta API. + public partial interface IOrgContactUser : IResource + { + string UserId { get; set; } + + Task UpdateContactUserAsync(IUserIdString userId, + string contactType, CancellationToken cancellationToken = default(CancellationToken)); + + } +} diff --git a/src/Okta.Sdk/Generated/IOrgOktaCommunicationSetting.Generated.cs b/src/Okta.Sdk/Generated/IOrgOktaCommunicationSetting.Generated.cs new file mode 100644 index 000000000..9644dc575 --- /dev/null +++ b/src/Okta.Sdk/Generated/IOrgOktaCommunicationSetting.Generated.cs @@ -0,0 +1,27 @@ +// +// Copyright (c) 2014 - present 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 OrgOktaCommunicationSetting resource in the Okta API. + public partial interface IOrgOktaCommunicationSetting : IResource + { + bool? OptOutEmailUsers { get; } + + Task OptInUsersToOktaCommunicationEmailsAsync( + CancellationToken cancellationToken = default(CancellationToken)); + + Task OptOutUsersFromOktaCommunicationEmailsAsync( + CancellationToken cancellationToken = default(CancellationToken)); + + } +} diff --git a/src/Okta.Sdk/Generated/IOrgOktaSupportSettingsObj.Generated.cs b/src/Okta.Sdk/Generated/IOrgOktaSupportSettingsObj.Generated.cs new file mode 100644 index 000000000..fa57cbcca --- /dev/null +++ b/src/Okta.Sdk/Generated/IOrgOktaSupportSettingsObj.Generated.cs @@ -0,0 +1,32 @@ +// +// Copyright (c) 2014 - present 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 OrgOktaSupportSettingsObj resource in the Okta API. + public partial interface IOrgOktaSupportSettingsObj : IResource + { + DateTimeOffset? Expiration { get; } + + OrgOktaSupportSetting Support { get; } + + Task ExtendOktaSupportAsync( + CancellationToken cancellationToken = default(CancellationToken)); + + Task GrantOktaSupportAsync( + CancellationToken cancellationToken = default(CancellationToken)); + + Task RevokeOktaSupportAsync( + CancellationToken cancellationToken = default(CancellationToken)); + + } +} diff --git a/src/Okta.Sdk/Generated/IOrgPreferences.Generated.cs b/src/Okta.Sdk/Generated/IOrgPreferences.Generated.cs new file mode 100644 index 000000000..5cf03820b --- /dev/null +++ b/src/Okta.Sdk/Generated/IOrgPreferences.Generated.cs @@ -0,0 +1,27 @@ +// +// Copyright (c) 2014 - present 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 OrgPreferences resource in the Okta API. + public partial interface IOrgPreferences : IResource + { + bool? ShowEndUserFooter { get; } + + Task HideEndUserFooterAsync( + CancellationToken cancellationToken = default(CancellationToken)); + + Task ShowEndUserFooterAsync( + CancellationToken cancellationToken = default(CancellationToken)); + + } +} diff --git a/src/Okta.Sdk/Generated/IOrgSetting.Generated.cs b/src/Okta.Sdk/Generated/IOrgSetting.Generated.cs new file mode 100644 index 000000000..301670ead --- /dev/null +++ b/src/Okta.Sdk/Generated/IOrgSetting.Generated.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) 2014 - present 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 OrgSetting resource in the Okta API. + public partial interface IOrgSetting : IResource + { + string Address1 { get; set; } + + string Address2 { get; set; } + + string City { get; set; } + + string CompanyName { get; set; } + + string Country { get; set; } + + DateTimeOffset? Created { get; } + + string EndUserSupportHelpUrl { get; set; } + + DateTimeOffset? ExpiresAt { get; } + + string Id { get; } + + DateTimeOffset? LastUpdated { get; } + + string PhoneNumber { get; set; } + + string PostalCode { get; set; } + + string State { get; set; } + + string Status { get; } + + string Subdomain { get; } + + string SupportPhoneNumber { get; set; } + + string Website { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IOrgsClient.Generated.cs b/src/Okta.Sdk/Generated/IOrgsClient.Generated.cs new file mode 100644 index 000000000..dec06098b --- /dev/null +++ b/src/Okta.Sdk/Generated/IOrgsClient.Generated.cs @@ -0,0 +1,135 @@ +// +// Copyright (c) 2014 - present 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 +{ + /// A client that works with Okta Org resources. + public partial interface IOrgsClient + { + /// + /// Get settings of your organization. + /// + /// The cancellation token. + /// The response. + Task GetOrgSettingsAsync(CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Partial update settings of your organization. + /// + /// The resource. + /// The cancellation token. + /// The response. + Task PartialUpdateOrgSettingAsync(IOrgSetting orgSetting, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Update settings of your organization. + /// + /// The resource. + /// The cancellation token. + /// The response. + Task UpdateOrgSettingAsync(IOrgSetting orgSetting, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Gets Contact Types of your organization. + /// + /// A collection of that can be enumerated asynchronously. + ICollectionClient GetOrgContactTypes(); + + /// + /// Retrieves the URL of the User associated with the specified Contact Type. + /// + /// + /// The cancellation token. + /// The response. + Task GetOrgContactUserAsync(string contactType, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Updates the User associated with the specified Contact Type. + /// + /// The resource. + /// + /// The cancellation token. + /// The response. + Task UpdateOrgContactUserAsync(IUserIdString userId, string contactType, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Gets preferences of your organization. + /// + /// The cancellation token. + /// The response. + Task GetOrgPreferencesAsync(CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Hide the Okta UI footer for all end users of your organization. + /// + /// The cancellation token. + /// The response. + Task HideOktaUiFooterAsync(CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Makes the Okta UI footer visible for all end users of your organization. + /// + /// The cancellation token. + /// The response. + Task ShowOktaUiFooterAsync(CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Gets Okta Communication Settings of your organization. + /// + /// The cancellation token. + /// The response. + Task GetOktaCommunicationSettingsAsync(CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Opts in all users of this org to Okta Communication emails. + /// + /// The cancellation token. + /// The response. + Task OptInUsersToOktaCommunicationEmailsAsync(CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Opts out all users of this org from Okta Communication emails. + /// + /// The cancellation token. + /// The response. + Task OptOutUsersFromOktaCommunicationEmailsAsync(CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Gets Okta Support Settings of your organization. + /// + /// The cancellation token. + /// The response. + Task GetOrgOktaSupportSettingsAsync(CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Extends the length of time that Okta Support can access your org by 24 hours. This means that 24 hours are added to the remaining access time. + /// + /// The cancellation token. + /// The response. + Task ExtendOktaSupportAsync(CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Enables you to temporarily allow Okta Support to access your org as an administrator for eight hours. + /// + /// The cancellation token. + /// The response. + Task GrantOktaSupportAsync(CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Revokes Okta Support access to your organization. + /// + /// The cancellation token. + /// The response. + Task RevokeOktaSupportAsync(CancellationToken cancellationToken = default(CancellationToken)); + + } +} diff --git a/src/Okta.Sdk/Generated/IUserIdString.Generated.cs b/src/Okta.Sdk/Generated/IUserIdString.Generated.cs new file mode 100644 index 000000000..8edd5e621 --- /dev/null +++ b/src/Okta.Sdk/Generated/IUserIdString.Generated.cs @@ -0,0 +1,21 @@ +// +// Copyright (c) 2014 - present 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 UserIdString resource in the Okta API. + public partial interface IUserIdString : IResource + { + string UserId { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IUsersClient.Generated.cs b/src/Okta.Sdk/Generated/IUsersClient.Generated.cs index 07048e652..c01472a58 100644 --- a/src/Okta.Sdk/Generated/IUsersClient.Generated.cs +++ b/src/Okta.Sdk/Generated/IUsersClient.Generated.cs @@ -383,6 +383,15 @@ public partial interface IUsersClient /// A Task that represents the asynchronous operation. Task RemoveRoleFromUserAsync(string userId, string roleId, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets role that is assigne to user. + /// + /// + /// + /// The cancellation token. + /// The response. + Task GetUserRoleAsync(string userId, string roleId, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Lists all App targets for an `APP_ADMIN` Role assigned to a User. This methods return list may include full Applications or Instances. The response for an instance will have an `ID` value, while Application will not have an ID. /// diff --git a/src/Okta.Sdk/Generated/OrgContactType.Generated.cs b/src/Okta.Sdk/Generated/OrgContactType.Generated.cs new file mode 100644 index 000000000..d25ce2ca9 --- /dev/null +++ b/src/Okta.Sdk/Generated/OrgContactType.Generated.cs @@ -0,0 +1,37 @@ +// +// Copyright (c) 2014 - present 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 OrgContactType values in the Okta API. + /// + public sealed class OrgContactType : StringEnum + { + /// The BILLING OrgContactType. + public static OrgContactType Billing = new OrgContactType("BILLING"); + + /// The TECHNICAL OrgContactType. + public static OrgContactType Technical = new OrgContactType("TECHNICAL"); + + /// + /// Implicit operator declaration to accept and convert a string value as a + /// + /// The value to use + public static implicit operator OrgContactType(string value) => new OrgContactType(value); + + /// + /// Creates a new instance. + /// + /// The value to use. + public OrgContactType(string value) + : base(value) + { + } + + } +} diff --git a/src/Okta.Sdk/Generated/OrgContactTypeObj.Generated.cs b/src/Okta.Sdk/Generated/OrgContactTypeObj.Generated.cs new file mode 100644 index 000000000..7dfaddf2b --- /dev/null +++ b/src/Okta.Sdk/Generated/OrgContactTypeObj.Generated.cs @@ -0,0 +1,27 @@ +// +// Copyright (c) 2014 - present 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 OrgContactTypeObj : Resource, IOrgContactTypeObj + { + /// + public OrgContactType ContactType + { + get => GetEnumProperty("contactType"); + set => this["contactType"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/OrgContactUser.Generated.cs b/src/Okta.Sdk/Generated/OrgContactUser.Generated.cs new file mode 100644 index 000000000..2f6dde329 --- /dev/null +++ b/src/Okta.Sdk/Generated/OrgContactUser.Generated.cs @@ -0,0 +1,32 @@ +// +// Copyright (c) 2014 - present 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 OrgContactUser : Resource, IOrgContactUser + { + /// + public string UserId + { + get => GetStringProperty("userId"); + set => this["userId"] = value; + } + + /// + public Task UpdateContactUserAsync(IUserIdString userId, + string contactType, CancellationToken cancellationToken = default(CancellationToken)) + => GetClient().Orgs.UpdateOrgContactUserAsync(userId, contactType, cancellationToken); + + } +} diff --git a/src/Okta.Sdk/Generated/OrgOktaCommunicationSetting.Generated.cs b/src/Okta.Sdk/Generated/OrgOktaCommunicationSetting.Generated.cs new file mode 100644 index 000000000..4a197b22c --- /dev/null +++ b/src/Okta.Sdk/Generated/OrgOktaCommunicationSetting.Generated.cs @@ -0,0 +1,33 @@ +// +// Copyright (c) 2014 - present 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 OrgOktaCommunicationSetting : Resource, IOrgOktaCommunicationSetting + { + /// + public bool? OptOutEmailUsers => GetBooleanProperty("optOutEmailUsers"); + + /// + public Task OptInUsersToOktaCommunicationEmailsAsync( + CancellationToken cancellationToken = default(CancellationToken)) + => GetClient().Orgs.OptInUsersToOktaCommunicationEmailsAsync(cancellationToken); + + /// + public Task OptOutUsersFromOktaCommunicationEmailsAsync( + CancellationToken cancellationToken = default(CancellationToken)) + => GetClient().Orgs.OptOutUsersFromOktaCommunicationEmailsAsync(cancellationToken); + + } +} diff --git a/src/Okta.Sdk/Generated/OrgOktaSupportSetting.Generated.cs b/src/Okta.Sdk/Generated/OrgOktaSupportSetting.Generated.cs new file mode 100644 index 000000000..5139f39f5 --- /dev/null +++ b/src/Okta.Sdk/Generated/OrgOktaSupportSetting.Generated.cs @@ -0,0 +1,37 @@ +// +// Copyright (c) 2014 - present 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 OrgOktaSupportSetting values in the Okta API. + /// + public sealed class OrgOktaSupportSetting : StringEnum + { + /// The DISABLED OrgOktaSupportSetting. + public static OrgOktaSupportSetting Disabled = new OrgOktaSupportSetting("DISABLED"); + + /// The ENABLED OrgOktaSupportSetting. + public static OrgOktaSupportSetting Enabled = new OrgOktaSupportSetting("ENABLED"); + + /// + /// Implicit operator declaration to accept and convert a string value as a + /// + /// The value to use + public static implicit operator OrgOktaSupportSetting(string value) => new OrgOktaSupportSetting(value); + + /// + /// Creates a new instance. + /// + /// The value to use. + public OrgOktaSupportSetting(string value) + : base(value) + { + } + + } +} diff --git a/src/Okta.Sdk/Generated/OrgOktaSupportSettingsObj.Generated.cs b/src/Okta.Sdk/Generated/OrgOktaSupportSettingsObj.Generated.cs new file mode 100644 index 000000000..873cc0f5a --- /dev/null +++ b/src/Okta.Sdk/Generated/OrgOktaSupportSettingsObj.Generated.cs @@ -0,0 +1,41 @@ +// +// Copyright (c) 2014 - present 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 OrgOktaSupportSettingsObj : Resource, IOrgOktaSupportSettingsObj + { + /// + public DateTimeOffset? Expiration => GetDateTimeProperty("expiration"); + + /// + public OrgOktaSupportSetting Support => GetEnumProperty("support"); + + /// + public Task ExtendOktaSupportAsync( + CancellationToken cancellationToken = default(CancellationToken)) + => GetClient().Orgs.ExtendOktaSupportAsync(cancellationToken); + + /// + public Task GrantOktaSupportAsync( + CancellationToken cancellationToken = default(CancellationToken)) + => GetClient().Orgs.GrantOktaSupportAsync(cancellationToken); + + /// + public Task RevokeOktaSupportAsync( + CancellationToken cancellationToken = default(CancellationToken)) + => GetClient().Orgs.RevokeOktaSupportAsync(cancellationToken); + + } +} diff --git a/src/Okta.Sdk/Generated/OrgPreferences.Generated.cs b/src/Okta.Sdk/Generated/OrgPreferences.Generated.cs new file mode 100644 index 000000000..565754c60 --- /dev/null +++ b/src/Okta.Sdk/Generated/OrgPreferences.Generated.cs @@ -0,0 +1,33 @@ +// +// Copyright (c) 2014 - present 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 OrgPreferences : Resource, IOrgPreferences + { + /// + public bool? ShowEndUserFooter => GetBooleanProperty("showEndUserFooter"); + + /// + public Task HideEndUserFooterAsync( + CancellationToken cancellationToken = default(CancellationToken)) + => GetClient().Orgs.HideOktaUiFooterAsync(cancellationToken); + + /// + public Task ShowEndUserFooterAsync( + CancellationToken cancellationToken = default(CancellationToken)) + => GetClient().Orgs.ShowOktaUiFooterAsync(cancellationToken); + + } +} diff --git a/src/Okta.Sdk/Generated/OrgSetting.Generated.cs b/src/Okta.Sdk/Generated/OrgSetting.Generated.cs new file mode 100644 index 000000000..2faedab79 --- /dev/null +++ b/src/Okta.Sdk/Generated/OrgSetting.Generated.cs @@ -0,0 +1,115 @@ +// +// Copyright (c) 2014 - present 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 OrgSetting : Resource, IOrgSetting + { + /// + public string Address1 + { + get => GetStringProperty("address1"); + set => this["address1"] = value; + } + + /// + public string Address2 + { + get => GetStringProperty("address2"); + set => this["address2"] = value; + } + + /// + public string City + { + get => GetStringProperty("city"); + set => this["city"] = value; + } + + /// + public string CompanyName + { + get => GetStringProperty("companyName"); + set => this["companyName"] = value; + } + + /// + public string Country + { + get => GetStringProperty("country"); + set => this["country"] = value; + } + + /// + public DateTimeOffset? Created => GetDateTimeProperty("created"); + + /// + public string EndUserSupportHelpUrl + { + get => GetStringProperty("endUserSupportHelpURL"); + set => this["endUserSupportHelpURL"] = value; + } + + /// + public DateTimeOffset? ExpiresAt => GetDateTimeProperty("expiresAt"); + + /// + public string Id => GetStringProperty("id"); + + /// + public DateTimeOffset? LastUpdated => GetDateTimeProperty("lastUpdated"); + + /// + public string PhoneNumber + { + get => GetStringProperty("phoneNumber"); + set => this["phoneNumber"] = value; + } + + /// + public string PostalCode + { + get => GetStringProperty("postalCode"); + set => this["postalCode"] = value; + } + + /// + public string State + { + get => GetStringProperty("state"); + set => this["state"] = value; + } + + /// + public string Status => GetStringProperty("status"); + + /// + public string Subdomain => GetStringProperty("subdomain"); + + /// + public string SupportPhoneNumber + { + get => GetStringProperty("supportPhoneNumber"); + set => this["supportPhoneNumber"] = value; + } + + /// + public string Website + { + get => GetStringProperty("website"); + set => this["website"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/OrgsClient.Generated.cs b/src/Okta.Sdk/Generated/OrgsClient.Generated.cs new file mode 100644 index 000000000..9db411ea0 --- /dev/null +++ b/src/Okta.Sdk/Generated/OrgsClient.Generated.cs @@ -0,0 +1,184 @@ +// +// Copyright (c) 2014 - present 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 OrgsClient : OktaClient, IOrgsClient + { + // Remove parameterless constructor + private OrgsClient() + { + } + + internal OrgsClient(IDataStore dataStore, OktaClientConfiguration configuration, RequestContext requestContext) + : base(dataStore, configuration, requestContext) + { + } + + /// + public async Task GetOrgSettingsAsync(CancellationToken cancellationToken = default(CancellationToken)) + => await GetAsync(new HttpRequest + { + Uri = "/api/v1/org", + Verb = HttpVerb.Get, + + }, cancellationToken).ConfigureAwait(false); + + /// + public async Task PartialUpdateOrgSettingAsync(IOrgSetting orgSetting, CancellationToken cancellationToken = default(CancellationToken)) + => await PostAsync(new HttpRequest + { + Uri = "/api/v1/org", + Verb = HttpVerb.Post, + Payload = orgSetting, + }, cancellationToken).ConfigureAwait(false); + + /// + public async Task UpdateOrgSettingAsync(IOrgSetting orgSetting, CancellationToken cancellationToken = default(CancellationToken)) + => await PutAsync(new HttpRequest + { + Uri = "/api/v1/org", + Verb = HttpVerb.Put, + Payload = orgSetting, + }, cancellationToken).ConfigureAwait(false); + + /// + public ICollectionClient GetOrgContactTypes() + => GetCollectionClient(new HttpRequest + { + Uri = "/api/v1/org/contacts", + Verb = HttpVerb.Get, + + }); + + /// + public async Task GetOrgContactUserAsync(string contactType, CancellationToken cancellationToken = default(CancellationToken)) + => await GetAsync(new HttpRequest + { + Uri = "/api/v1/org/contacts/{contactType}", + Verb = HttpVerb.Get, + + PathParameters = new Dictionary() + { + ["contactType"] = contactType, + }, + }, cancellationToken).ConfigureAwait(false); + + /// + public async Task UpdateOrgContactUserAsync(IUserIdString userId, string contactType, CancellationToken cancellationToken = default(CancellationToken)) + => await PutAsync(new HttpRequest + { + Uri = "/api/v1/org/contacts/{contactType}", + Verb = HttpVerb.Put, + Payload = userId, + PathParameters = new Dictionary() + { + ["contactType"] = contactType, + }, + }, cancellationToken).ConfigureAwait(false); + + /// + public async Task GetOrgPreferencesAsync(CancellationToken cancellationToken = default(CancellationToken)) + => await GetAsync(new HttpRequest + { + Uri = "/api/v1/org/preferences", + Verb = HttpVerb.Get, + + }, cancellationToken).ConfigureAwait(false); + + /// + public async Task HideOktaUiFooterAsync(CancellationToken cancellationToken = default(CancellationToken)) + => await PostAsync(new HttpRequest + { + Uri = "/api/v1/org/preferences/hideEndUserFooter", + Verb = HttpVerb.Post, + + }, cancellationToken).ConfigureAwait(false); + + /// + public async Task ShowOktaUiFooterAsync(CancellationToken cancellationToken = default(CancellationToken)) + => await PostAsync(new HttpRequest + { + Uri = "/api/v1/org/preferences/showEndUserFooter", + Verb = HttpVerb.Post, + + }, cancellationToken).ConfigureAwait(false); + + /// + public async Task GetOktaCommunicationSettingsAsync(CancellationToken cancellationToken = default(CancellationToken)) + => await GetAsync(new HttpRequest + { + Uri = "/api/v1/org/privacy/oktaCommunication", + Verb = HttpVerb.Get, + + }, cancellationToken).ConfigureAwait(false); + + /// + public async Task OptInUsersToOktaCommunicationEmailsAsync(CancellationToken cancellationToken = default(CancellationToken)) + => await PostAsync(new HttpRequest + { + Uri = "/api/v1/org/privacy/oktaCommunication/optIn", + Verb = HttpVerb.Post, + + }, cancellationToken).ConfigureAwait(false); + + /// + public async Task OptOutUsersFromOktaCommunicationEmailsAsync(CancellationToken cancellationToken = default(CancellationToken)) + => await PostAsync(new HttpRequest + { + Uri = "/api/v1/org/privacy/oktaCommunication/optOut", + Verb = HttpVerb.Post, + + }, cancellationToken).ConfigureAwait(false); + + /// + public async Task GetOrgOktaSupportSettingsAsync(CancellationToken cancellationToken = default(CancellationToken)) + => await GetAsync(new HttpRequest + { + Uri = "/api/v1/org/privacy/oktaSupport", + Verb = HttpVerb.Get, + + }, cancellationToken).ConfigureAwait(false); + + /// + public async Task ExtendOktaSupportAsync(CancellationToken cancellationToken = default(CancellationToken)) + => await PostAsync(new HttpRequest + { + Uri = "/api/v1/org/privacy/oktaSupport/extend", + Verb = HttpVerb.Post, + + }, cancellationToken).ConfigureAwait(false); + + /// + public async Task GrantOktaSupportAsync(CancellationToken cancellationToken = default(CancellationToken)) + => await PostAsync(new HttpRequest + { + Uri = "/api/v1/org/privacy/oktaSupport/grant", + Verb = HttpVerb.Post, + + }, cancellationToken).ConfigureAwait(false); + + /// + public async Task RevokeOktaSupportAsync(CancellationToken cancellationToken = default(CancellationToken)) + => await PostAsync(new HttpRequest + { + Uri = "/api/v1/org/privacy/oktaSupport/revoke", + Verb = HttpVerb.Post, + + }, cancellationToken).ConfigureAwait(false); + + } +} diff --git a/src/Okta.Sdk/Generated/RoleType.Generated.cs b/src/Okta.Sdk/Generated/RoleType.Generated.cs index aa56a7e46..4af0bf795 100644 --- a/src/Okta.Sdk/Generated/RoleType.Generated.cs +++ b/src/Okta.Sdk/Generated/RoleType.Generated.cs @@ -39,6 +39,9 @@ public sealed class RoleType : StringEnum /// The REPORT_ADMIN RoleType. public static RoleType ReportAdmin = new RoleType("REPORT_ADMIN"); + /// The GROUP_MEMBERSHIP_ADMIN RoleType. + public static RoleType GroupMembershipAdmin = new RoleType("GROUP_MEMBERSHIP_ADMIN"); + /// /// Implicit operator declaration to accept and convert a string value as a /// diff --git a/src/Okta.Sdk/Generated/UserIdString.Generated.cs b/src/Okta.Sdk/Generated/UserIdString.Generated.cs new file mode 100644 index 000000000..16ea77d8f --- /dev/null +++ b/src/Okta.Sdk/Generated/UserIdString.Generated.cs @@ -0,0 +1,27 @@ +// +// Copyright (c) 2014 - present 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 UserIdString : Resource, IUserIdString + { + /// + public string UserId + { + get => GetStringProperty("userId"); + set => this["userId"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/UsersClient.Generated.cs b/src/Okta.Sdk/Generated/UsersClient.Generated.cs index 1f5d7bf3d..ac94b4b7b 100644 --- a/src/Okta.Sdk/Generated/UsersClient.Generated.cs +++ b/src/Okta.Sdk/Generated/UsersClient.Generated.cs @@ -653,6 +653,20 @@ public ICollectionClient ListAssignedRolesForUser(string userId, string e }, }, cancellationToken).ConfigureAwait(false); + /// + public async Task GetUserRoleAsync(string userId, string roleId, CancellationToken cancellationToken = default(CancellationToken)) + => await GetAsync(new HttpRequest + { + Uri = "/api/v1/users/{userId}/roles/{roleId}", + Verb = HttpVerb.Get, + + PathParameters = new Dictionary() + { + ["userId"] = userId, + ["roleId"] = roleId, + }, + }, cancellationToken).ConfigureAwait(false); + /// public ICollectionClient ListApplicationTargetsForApplicationAdministratorRoleForUser(string userId, string roleId, string after = null, int? limit = 20) => GetCollectionClient(new HttpRequest diff --git a/src/Okta.Sdk/IOktaClient.cs b/src/Okta.Sdk/IOktaClient.cs index 9eab237ad..7e71f370b 100644 --- a/src/Okta.Sdk/IOktaClient.cs +++ b/src/Okta.Sdk/IOktaClient.cs @@ -23,6 +23,21 @@ public interface IOktaClient /// The configuration is immutable after the client is initialized. This property references a copy of the configuration. OktaClientConfiguration Configuration { get; } + /// + /// Gets a GroupSchemasClient that interacts with the schemas API. + /// + IGroupSchemasClient GroupSchemas { get; } + + /// + /// Gets a AuthenticatorsClient that interacts with the Authenticators API. + /// + IAuthenticatorsClient Authenticators { get; } + + /// + /// Gets a OrgsClient that interacts with the Orgs API. + /// + IOrgsClient Orgs { get; } + /// /// Gets a UserTypesClient that interacts with the Okta User Types API. /// diff --git a/src/Okta.Sdk/OktaClient.cs b/src/Okta.Sdk/OktaClient.cs index a3cf04bba..1b28d02ad 100644 --- a/src/Okta.Sdk/OktaClient.cs +++ b/src/Okta.Sdk/OktaClient.cs @@ -159,6 +159,15 @@ private static OktaClientConfiguration GetConfigurationOrDefault(OktaClientConfi public IOktaClient CreateScoped(RequestContext requestContext) => new OktaClient(_dataStore, Configuration, requestContext); + /// + public IGroupSchemasClient GroupSchemas => new GroupSchemasClient(_dataStore, Configuration, _requestContext); + + /// + public IAuthenticatorsClient Authenticators => new AuthenticatorsClient(_dataStore, Configuration, _requestContext); + + /// + public IOrgsClient Orgs => new OrgsClient(_dataStore, Configuration, _requestContext); + /// public IUserTypesClient UserTypes => new UserTypesClient(_dataStore, Configuration, _requestContext);