diff --git a/CHANGELOG.md b/CHANGELOG.md index 21c3e4ace..00204c99e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,19 @@ Running changelog of releases since `3.1.1` -## v5.2.2 +## v5.3.0 ### Features -- Add ability to use pre-requested access tokens for authentication. #508 +- Add ability to use pre-requested access tokens for authentication (#508) +- Regenerate code using the [open API spec v2.9.2](https://github.com/okta/okta-management-openapi-spec/releases/tag/openapi-2.9.2) +- Add new models and operations to support [Brands API's endpoints](https://developer.okta.com/docs/reference/api/brands/) +- Add new models and operations to support [OIE policies](https://developer.okta.com/docs/reference/api/policy/) + +### Updates + +- `Group.AssignRoleAsync(IAssignRoleRequest assignRoleRequest, string disableNotifications, CancellationToken cancellationToken = default(CancellationToken));` is not marked as obsolete. Use `Group.AssignRoleAsync(IAssignRoleRequest assignRoleRequest, bool? disableNotifications = null, CancellationToken cancellationToken = default(CancellationToken));` instead. +- `UsersClient. AssignRoleToUserAsync(IAssignRoleRequest assignRoleRequest, string userId, string disableNotifications, CancellationToken cancellationToken = default(CancellationToken));` is not marked as obsolete. Use `UsersClient. AssignRoleToUserAsync(IAssignRoleRequest assignRoleRequest, string userId, bool? disableNotifications = null, CancellationToken cancellationToken = default(CancellationToken));` instead. ## v5.2.1 diff --git a/openapi/errata.js b/openapi/errata.js index 68635e0be..f6e8081c9 100644 --- a/openapi/errata.js +++ b/openapi/errata.js @@ -146,6 +146,7 @@ const modelErrata = [ { path: 'CSRMetadataSubjectAltNames', rename: 'CsrMetadataSubjectAltNames', renameReason: 'Pattern consistency' }, { path: 'UserSchema', includeNullValues: true }, { path: 'GroupSchema', includeNullValues: true }, + { path: 'AuthenticatorProviderConfigurationUserNamePlate', rename: 'AuthenticatorProviderConfigurationUserNameTemplate', renameReason: 'Fix typo' }, ]; const operationErrata = [ @@ -316,6 +317,10 @@ const modelMethodSkipList = [ { path: 'User.listGroups', reason: 'Implemented as IUser.Groups' }, { path: 'User.resetPassword', reason: 'Simplified as IUser.ResetPasswordAsync(bool)' }, { path: 'Group.listUsers', reason: 'Implemented as IGroup.Users' }, + { path: 'Theme.updateBrandThemeBackgroundImage', reason: 'Implemented manually' }, + { path: 'Theme.updateBrandThemeFavicon', reason: 'Implemented manually' }, + { path: 'Theme.uploadBrandThemeLogo', reason: 'Implemented manually' }, + { path: 'OrgSetting.updateOrgLogo', reason: 'Implemented manually' } ]; function shouldSkipModelMethod(fullPath) { @@ -336,6 +341,10 @@ const operationSkipList = [ { id: 'publishDerCert', reason: 'Operation defined manually' }, { id: 'publishBinaryDerCert', reason: 'Operation defined manually' }, { id: 'publishBinaryPemCert', reason: 'Operation defined manually' }, + { id: 'uploadBrandThemeBackgroundImage', reason: 'Operation defined manually'}, + { id: 'uploadBrandThemeFavicon', reason: 'Operation defined manually'}, + { id: 'uploadBrandThemeLogo', reason: 'Operation defined manually'}, + { id: 'updateOrgLogo', reason: 'Operation defined manually'} ]; function shouldSkipOperation(operationId) { diff --git a/openapi/package-lock.json b/openapi/package-lock.json index 9ea16d91a..421ed7861 100644 --- a/openapi/package-lock.json +++ b/openapi/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "@okta/openapi": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/@okta/openapi/-/openapi-2.7.1.tgz", - "integrity": "sha512-FsOgeD5AjMJIGfVKuPeDDbi0YkCKOSUc0lhB2Ik6hMXbDDCZTTMgcI+4o1+IOZTr9pssCx/11kU4MWXGGousuw==", + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/@okta/openapi/-/openapi-2.9.2.tgz", + "integrity": "sha512-GhUDr7gawiGz5yGKETqReSgt6PvbKMHnFOxs4Gu/mG6tQAruJ7d42Y6ZK3JA2e0/6bBlxc7IsNfukaCVcOZALg==", "dev": true, "requires": { "commander": "2.9.0", @@ -276,9 +276,9 @@ "dev": true }, "node-fetch": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz", - "integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==", + "version": "2.6.6", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.6.tgz", + "integrity": "sha512-Z8/6vRlTUChSdIgMa51jxQ4lrw/Jy5SOW10ObaA47/RElsAN2c5Pn8bTgFGWn/ibwzXTE8qwr1Yzx28vsecXEA==", "dev": true, "requires": { "whatwg-url": "^5.0.0" @@ -432,9 +432,9 @@ "dev": true }, "uglify-js": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.2.tgz", - "integrity": "sha512-rtPMlmcO4agTUfz10CbgJ1k6UAoXM2gWb3GoMPPZB/+/Ackf8lNWk11K4rYi2D0apgoFRLtQOZhb+/iGNJq26A==", + "version": "3.14.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.3.tgz", + "integrity": "sha512-mic3aOdiq01DuSVx0TseaEzMIVqebMZ0Z3vaeDhFEh9bsc24hV1TFvN74reA2vs08D0ZWfNjAcJ3UbVLaBss+g==", "dev": true, "optional": true }, @@ -445,9 +445,9 @@ "dev": true }, "validator": { - "version": "13.6.0", - "resolved": "https://registry.npmjs.org/validator/-/validator-13.6.0.tgz", - "integrity": "sha512-gVgKbdbHgtxpRyR8K0O6oFZPhhB5tT1jeEHZR0Znr9Svg03U0+r9DXWMrnRAB+HtCStDQKlaIZm42tVsVjqtjg==", + "version": "13.7.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.7.0.tgz", + "integrity": "sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==", "dev": true }, "webidl-conversions": { diff --git a/openapi/package.json b/openapi/package.json index 7e8288c86..739128c3b 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.7.1", + "@okta/openapi": "^2.9.2", "json-stable-stringify": "^1.0.1", "lodash": "^4.17.21" } diff --git a/src/Okta.Sdk.IntegrationTests/ApplicationScenarios.cs b/src/Okta.Sdk.IntegrationTests/ApplicationScenarios.cs index dbd94ede8..c7e2177b5 100644 --- a/src/Okta.Sdk.IntegrationTests/ApplicationScenarios.cs +++ b/src/Okta.Sdk.IntegrationTests/ApplicationScenarios.cs @@ -1858,6 +1858,5 @@ public async Task UpdateApplicationProfile() await oktaClient.Applications.DeleteApplicationAsync(newApp.Id); } } - } } diff --git a/src/Okta.Sdk.IntegrationTests/AuthenticatorScenarios.cs b/src/Okta.Sdk.IntegrationTests/AuthenticatorScenarios.cs index 6c610844a..a716af297 100644 --- a/src/Okta.Sdk.IntegrationTests/AuthenticatorScenarios.cs +++ b/src/Okta.Sdk.IntegrationTests/AuthenticatorScenarios.cs @@ -43,5 +43,31 @@ public async Task GetAuthenticatorByIdAsync() retrievedAuthenticator.Created.Should().Be(passwordAuthenticator.Created); retrievedAuthenticator.Settings.Should().Be(passwordAuthenticator.Settings); } + + [Fact] + public async Task UpdateAuthenticatorsAsync() + { + var client = TestClient.Create(); + + var authenticator = await client.Authenticators.ListAuthenticators().FirstOrDefaultAsync(); + + var originalName = authenticator.Name; + var originalAllowedFor = authenticator.Settings.AllowedFor; + + authenticator.Name = originalName + "-updated"; + authenticator.Settings.AllowedFor = AllowedForEnum.Any; + try + { + var updatedAuthenticator = await client.Authenticators.UpdateAuthenticatorAsync(authenticator, authenticator.Id); + updatedAuthenticator.Name.Should().Be(authenticator.Name); + updatedAuthenticator.Settings.AllowedFor.Should().Be(AllowedForEnum.Any); + } + finally + { + authenticator.Name = originalName; + authenticator.Settings.AllowedFor = originalAllowedFor; + await client.Authenticators.UpdateAuthenticatorAsync(authenticator, authenticator.Id); + } + } } } diff --git a/src/Okta.Sdk.IntegrationTests/BrandScenarios.cs b/src/Okta.Sdk.IntegrationTests/BrandScenarios.cs new file mode 100644 index 000000000..f21a6ecc7 --- /dev/null +++ b/src/Okta.Sdk.IntegrationTests/BrandScenarios.cs @@ -0,0 +1,154 @@ +// +// 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.IO; +using System.Linq; +using System.Threading.Tasks; +using FluentAssertions; +using FluentAssertions.Extensions; +using Xunit; + +namespace Okta.Sdk.IntegrationTests +{ + public class BrandScenarios + { + [Fact] + public async Task UpdateBrand() + { + var client = TestClient.Create(); + + var brand = await client.Brands.ListBrands().FirstOrDefaultAsync(); + var originalCustomPrivacyPolicyUrl = brand.CustomPrivacyPolicyUrl; + + brand.CustomPrivacyPolicyUrl = "https://www.someHost.com/privacy-policy"; + brand.AgreeToCustomPrivacyPolicy = true; + + try + { + var updatedBrand = await client.Brands.UpdateBrandAsync(brand, brand.Id); + updatedBrand.Id.Should().Be(brand.Id); + updatedBrand.CustomPrivacyPolicyUrl.Should().Be(brand.CustomPrivacyPolicyUrl); + } + finally + { + brand.CustomPrivacyPolicyUrl = originalCustomPrivacyPolicyUrl; + await client.Brands.UpdateBrandAsync(brand, brand.Id); + } + } + + [Fact] + public async Task ListBrands() + { + var client = TestClient.Create(); + + var brands = await client.Brands.ListBrands().ToListAsync(); + + brands.Should().NotBeNullOrEmpty(); + brands.First().Id.Should().NotBeNullOrEmpty(); + } + + [Fact] + public async Task GetBrand() + { + var client = TestClient.Create(); + + var brand = await client.Brands.ListBrands().FirstOrDefaultAsync(); + + var retrievedBrand = await client.Brands.GetBrandAsync(brand.Id); + + retrievedBrand.Id.Should().Be(brand.Id); + retrievedBrand.CustomPrivacyPolicyUrl.Should().Be(brand.CustomPrivacyPolicyUrl); + retrievedBrand.RemovePoweredByOkta.Should().Be(brand.RemovePoweredByOkta); + } + + [Fact] + public async Task GetBrandThemes() + { + var client = TestClient.Create(); + + var brand = await client.Brands.ListBrands().FirstOrDefaultAsync(); + + var themes = await client.Brands.ListBrandThemes(brand.Id).ToListAsync(); + themes.Should().NotBeNullOrEmpty(); + themes.First().Id.Should().NotBeNullOrEmpty(); + } + + [Fact] + public async Task GetBrandTheme() + { + var client = TestClient.Create(); + + var brand = await client.Brands.ListBrands().FirstOrDefaultAsync(); + + var theme = await client.Brands.ListBrandThemes(brand.Id).FirstOrDefaultAsync(); + + var retrievedTheme = await client.Brands.GetBrandThemeAsync(brand.Id, theme.Id); + retrievedTheme.Id.Should().Be(theme.Id); + retrievedTheme.BackgroundImage.Should().Be(theme.BackgroundImage); + retrievedTheme.EmailTemplateTouchPointVariant.Should().Be(theme.EmailTemplateTouchPointVariant); + retrievedTheme.EndUserDashboardTouchPointVariant.Should().Be(theme.EndUserDashboardTouchPointVariant); + retrievedTheme.ErrorPageTouchPointVariant.Should().Be(theme.ErrorPageTouchPointVariant); + retrievedTheme.Favicon.Should().Be(theme.Favicon); + retrievedTheme.Logo.Should().Be(theme.Logo); + retrievedTheme.PrimaryColorContrastHex.Should().Be(theme.PrimaryColorContrastHex); + retrievedTheme.PrimaryColorHex.Should().Be(theme.PrimaryColorHex); + retrievedTheme.SecondaryColorContrastHex.Should().Be(theme.SecondaryColorContrastHex); + retrievedTheme.SecondaryColorHex.Should().Be(theme.SecondaryColorHex); + retrievedTheme.SignInPageTouchPointVariant.Should().Be(theme.SignInPageTouchPointVariant); + } + + [Fact] + public async Task UpdateBrandTheme() + { + var client = TestClient.Create(); + + var brand = await client.Brands.ListBrands().FirstOrDefaultAsync(); + + var theme = await client.Brands.ListBrandThemes(brand.Id).FirstOrDefaultAsync(); + + var originalPrimaryColorHex = theme.PrimaryColorHex; + var originalSecondaryColorHex = theme.SecondaryColorHex; + var originalSignInPageTouchPointVariant = theme.SignInPageTouchPointVariant; + var originalEndUserDashboardTouchPointVariant = theme.EndUserDashboardTouchPointVariant; + var originalErrorPageTouchPointVariant = theme.ErrorPageTouchPointVariant; + var originalEmailTemplateTouchPointVariant = theme.EmailTemplateTouchPointVariant; + + var themeToUpdate = new Theme + { + PrimaryColorHex = "#1662dd", + SecondaryColorHex = "#ebebed", + SignInPageTouchPointVariant = SignInPageTouchPointVariant.OktaDefault, + EndUserDashboardTouchPointVariant = EndUserDashboardTouchPointVariant.OktaDefault, + ErrorPageTouchPointVariant = ErrorPageTouchPointVariant.OktaDefault, + EmailTemplateTouchPointVariant = EmailTemplateTouchPointVariant.OktaDefault, + }; + + try + { + var updatedTheme = await client.Brands.UpdateBrandThemeAsync(themeToUpdate, brand.Id, theme.Id); + + updatedTheme.Id.Should().Be(theme.Id); + updatedTheme.PrimaryColorHex.Should().Be(themeToUpdate.PrimaryColorHex); + updatedTheme.SecondaryColorHex.Should().Be(themeToUpdate.SecondaryColorHex); + updatedTheme.SignInPageTouchPointVariant.Should().Be(themeToUpdate.SignInPageTouchPointVariant); + updatedTheme.EndUserDashboardTouchPointVariant.Should().Be(themeToUpdate.EndUserDashboardTouchPointVariant); + updatedTheme.ErrorPageTouchPointVariant.Should().Be(themeToUpdate.ErrorPageTouchPointVariant); + updatedTheme.EmailTemplateTouchPointVariant.Should().Be(themeToUpdate.EmailTemplateTouchPointVariant); + } + finally + { + themeToUpdate.PrimaryColorHex = originalPrimaryColorHex; + themeToUpdate.SecondaryColorHex = originalSecondaryColorHex; + themeToUpdate.SignInPageTouchPointVariant = originalSignInPageTouchPointVariant; + themeToUpdate.EndUserDashboardTouchPointVariant = originalEndUserDashboardTouchPointVariant; + themeToUpdate.ErrorPageTouchPointVariant = originalErrorPageTouchPointVariant; + themeToUpdate.EmailTemplateTouchPointVariant = originalEmailTemplateTouchPointVariant; + await client.Brands.UpdateBrandThemeAsync(themeToUpdate, brand.Id, theme.Id); + } + } + } +} diff --git a/src/Okta.Sdk.IntegrationTests/FactorScenarios.cs b/src/Okta.Sdk.IntegrationTests/FactorScenarios.cs index e885428ef..7944a0335 100644 --- a/src/Okta.Sdk.IntegrationTests/FactorScenarios.cs +++ b/src/Okta.Sdk.IntegrationTests/FactorScenarios.cs @@ -37,14 +37,14 @@ public async Task EnrollSecurityQuestionFactor() try { - await createdUser.AddFactorAsync(new AddSecurityQuestionFactorOptions + var createdUserFactor = await createdUser.AddFactorAsync(new AddSecurityQuestionFactorOptions { Question = "disliked_food", Answer = "mayonnaise", }); var factors = await createdUser.ListFactors().ToArrayAsync(); - factors.Count().Should().Be(1); + factors.Any(x => x.Id == createdUserFactor.Id).Should().BeTrue(); var securityQuestionFactor = await createdUser.ListFactors().OfType().FirstOrDefaultAsync(); securityQuestionFactor.Should().NotBeNull(); @@ -81,14 +81,13 @@ public async Task EnrollSmsFactor() try { - await createdUser.AddFactorAsync(new AddSmsFactorOptions() + var createdUserFactor = await createdUser.AddFactorAsync(new AddSmsFactorOptions() { PhoneNumber = "+16284001133‬", }); var factors = await createdUser.ListFactors().ToArrayAsync(); - factors.Count().Should().Be(1); - + factors.Any(x => x.Id == createdUserFactor.Id).Should().BeTrue(); var smsFactor = await createdUser.ListFactors().OfType().FirstOrDefaultAsync(); smsFactor.Should().NotBeNull(); smsFactor.FactorType.Should().Be(FactorType.Sms); @@ -100,39 +99,6 @@ await createdUser.AddFactorAsync(new AddSmsFactorOptions() } } - [Fact] - public async Task ListFactorsForNewUser() - { - var client = TestClient.Create(); - var guid = Guid.NewGuid(); - - var profile = new UserProfile - { - FirstName = "Jack", - LastName = "List-Factors", - Email = $"jack-list-factors-dotnet-sdk-{guid}@example.com", - Login = $"jack-list-factors-dotnet-sdk-{guid}@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.ToArrayAsync(); - factors.Count().Should().Be(0); - } - finally - { - await createdUser.DeactivateAsync(); - await createdUser.DeactivateOrDeleteAsync(); - } - } - [Fact] public async Task GetFactor() { @@ -211,7 +177,7 @@ public async Task DeleteFactor() await createdUser.DeleteFactorAsync(retrievedUserFactor.Id); var factors = await createdUser.ListFactors().ToArrayAsync(); - factors.Count().Should().Be(0); + factors.Any(x => x.Id == createdUserFactor.Id).Should().BeFalse(); } finally { @@ -256,7 +222,7 @@ public async Task ResetFactors() await createdUser.ResetFactorsAsync(); var factors = await createdUser.ListFactors().ToArrayAsync(); - factors.Count().Should().Be(0); + factors.Any(x => x.Id == createdUserFactor.Id).Should().BeFalse(); } finally { diff --git a/src/Okta.Sdk.IntegrationTests/IdentityProvidersScenarios.cs b/src/Okta.Sdk.IntegrationTests/IdentityProvidersScenarios.cs index 72b829e24..bd630aef9 100644 --- a/src/Okta.Sdk.IntegrationTests/IdentityProvidersScenarios.cs +++ b/src/Okta.Sdk.IntegrationTests/IdentityProvidersScenarios.cs @@ -1571,7 +1571,7 @@ public async Task AddSamlIdp() createdIdp.Policy.Provisioning.Conditions.Suspended.Action.Should().Be("NONE"); createdIdp.Policy.AccountLink.Action.Should().Be("AUTO"); - createdIdp.Policy.Subject.UserNameTemplate.Template.Should().Be("idpuser.subjectNameId"); + createdIdp.Policy.Subject.UserNameTemplate.Template.Should().Be("idpuser.subjectNameId"); createdIdp.Policy.Subject.MatchType.Value.Should().Be("USERNAME"); createdIdp.Policy.Subject.MatchAttribute.Should().BeNull(); } diff --git a/src/Okta.Sdk.IntegrationTests/NetworkZoneScenarios.cs b/src/Okta.Sdk.IntegrationTests/NetworkZoneScenarios.cs index bc079dfa5..7254c5c12 100644 --- a/src/Okta.Sdk.IntegrationTests/NetworkZoneScenarios.cs +++ b/src/Okta.Sdk.IntegrationTests/NetworkZoneScenarios.cs @@ -3,6 +3,7 @@ // 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; @@ -126,7 +127,7 @@ private static NetworkZone BuildNetworkZoneObject() return new NetworkZone { Type = NetworkZoneType.Ip, - Name = "newNetworkZone", + Name = "newNetworkZone" + Guid.NewGuid(), Status = NetworkZoneStatus.Active, Gateways = new List { new NetworkZoneAddress diff --git a/src/Okta.Sdk.IntegrationTests/OrgScenarios.cs b/src/Okta.Sdk.IntegrationTests/OrgScenarios.cs index ff7a05016..d58007b16 100644 --- a/src/Okta.Sdk.IntegrationTests/OrgScenarios.cs +++ b/src/Okta.Sdk.IntegrationTests/OrgScenarios.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Threading.Tasks; using FluentAssertions; @@ -27,22 +28,19 @@ public async Task UpdateOrgSettings() orgSettings.Address1 = "301 Brannan St."; orgSettings.Address2 = guid.ToString(); - IOrgSetting updatedOrgSettings = null; - try { - updatedOrgSettings = await client.Orgs.UpdateOrgSettingAsync(orgSettings); + var 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); + orgSettings.PhoneNumber = string.Empty; + orgSettings.Address1 = string.Empty; + orgSettings.Address2 = string.Empty; + await client.Orgs.UpdateOrgSettingAsync(orgSettings); } } diff --git a/src/Okta.Sdk.IntegrationTests/PoliciesScenarios.cs b/src/Okta.Sdk.IntegrationTests/PoliciesScenarios.cs index caaa0e03d..9a3c37f30 100644 --- a/src/Okta.Sdk.IntegrationTests/PoliciesScenarios.cs +++ b/src/Okta.Sdk.IntegrationTests/PoliciesScenarios.cs @@ -45,6 +45,36 @@ public async Task CreateSignOnPolicy() } } + [Fact] + public async Task CreateProfileEnrollmentPolicy() + { + var client = TestClient.Create(); + + var policy = new Policy() + { + // Name has a maximum of 50 chars + Name = $"dotnet-sdk: ProfileEnrollmentPolicy {Guid.NewGuid()}".Substring(0, 50), + Type = PolicyType.ProfileEnrollment, + Status = "ACTIVE", + Description = "The default policy applies in all situations if no other policy applies.", + }; + + var createdPolicy = await client.Policies.CreatePolicyAsync(policy); + + try + { + createdPolicy.Should().NotBeNull(); + createdPolicy.Name.Should().Be(policy.Name); + createdPolicy.Type.Should().Be(PolicyType.ProfileEnrollment); + createdPolicy.Status.Should().Be("ACTIVE"); + createdPolicy.Description.Should().Be(policy.Description); + } + finally + { + await client.Policies.DeletePolicyAsync(createdPolicy.Id); + } + } + [Fact] public async Task GetPolicy() { @@ -432,6 +462,146 @@ public async Task CreatePasswordPolicyRule() } } + [Fact] + public async Task CreateAccessPolicyPolicyRule() + { + var client = TestClient.Create(); + var guid = Guid.NewGuid(); + + var createdApp = await client.Applications.CreateApplicationAsync(new CreateOpenIdConnectApplication + { + Label = $"dotnet-sdk: AddOpenIdConnectApp {guid}", + ClientUri = "https://example.com/client", + LogoUri = "https://example.com/assets/images/logo-new.png", + ResponseTypes = new List + { + OAuthResponseType.Token, + OAuthResponseType.IdToken, + OAuthResponseType.Code, + }, + RedirectUris = new List + { + "https://example.com/oauth2/callback", + "myapp://callback", + }, + PostLogoutRedirectUris = new List + { + "https://example.com/postlogout", + "myapp://postlogoutcallback", + }, + GrantTypes = new List + { + OAuthGrantType.Implicit, + OAuthGrantType.AuthorizationCode, + }, + ApplicationType = OpenIdConnectApplicationType.Web, + }); + + var accessPolicyId = createdApp.GetAccessPolicyId(); + + var accessPolicyRuleOptions = new AccessPolicyRule + { + Name = $"dotnet-sdk: CreateAccessPolicyRule {guid}".Substring(0, 50), + Type = PolicyType.AccessPolicy.ToString(), + Actions = new AccessPolicyRuleActions + { + AppSignOn = new AccessPolicyRuleApplicationSignOn + { + Access = "DENY", + VerificationMethod = new VerificationMethod + { + Type = "ASSURANCE", + FactorMode = "1FA", + ReauthenticateIn = "PT43800H", + }, + }, + }, + }; + + var createdPolicyRule = + await client.Policies.AddPolicyRuleAsync(accessPolicyRuleOptions, accessPolicyId); + try + { + createdPolicyRule.Should().NotBeNull(); + createdPolicyRule.Name.Should().Be(accessPolicyRuleOptions.Name); + createdPolicyRule.Actions.Should().NotBeNull(); + createdPolicyRule.Actions.AppSignOn.Access.Should().Be("DENY"); + createdPolicyRule.Actions.AppSignOn.VerificationMethod.Type.Should().Be("ASSURANCE"); + createdPolicyRule.Actions.AppSignOn.VerificationMethod.FactorMode.Should().Be("1FA"); + createdPolicyRule.Actions.AppSignOn.VerificationMethod.ReauthenticateIn.Should().Be("PT43800H"); + createdPolicyRule.Type.Should().Be(PolicyType.AccessPolicy); + } + finally + { + await client.Applications.DeactivateApplicationAsync(createdApp.Id); + await client.Applications.DeleteApplicationAsync(createdApp.Id); + } + } + + [Fact] + public async Task CreateProfileEnrollmentPolicyRule() + { + var client = TestClient.Create(); + + var policy = new Policy() + { + // Name has a maximum of 50 chars + Name = $"dotnet-sdk: ProfileEnrollmentPolicy {Guid.NewGuid()}".Substring(0, 50), + Type = PolicyType.ProfileEnrollment, + Status = "ACTIVE", + Description = "The default policy applies in all situations if no other policy applies.", + }; + + var createdPolicy = await client.Policies.CreatePolicyAsync(policy); + var defaultPolicyRule = await createdPolicy.ListPolicyRules().OfType().FirstOrDefaultAsync(); + var profileAttributes = new List(); + profileAttributes.Add(new ProfileEnrollmentPolicyRuleProfileAttribute + { + Name = "email", + Label = "Email", + Required = true, + }); + + defaultPolicyRule.Actions = new ProfileEnrollmentPolicyRuleActions + { + ProfileEnrollment = new ProfileEnrollmentPolicyRuleAction + { + Access = "ALLOW", + PreRegistrationInlineHooks = null, + ProfileAttributes = profileAttributes, + UnknownUserAction = "DENY", + TargetGroupIds = null, + ActivationRequirements = new ProfileEnrollmentPolicyRuleActivationRequirement + { + EmailVerification = true, + }, + }, + }; + + try + { + var createdPolicyRule = await client.Policies.UpdatePolicyRuleAsync(defaultPolicyRule, createdPolicy.Id, defaultPolicyRule.Id); + createdPolicyRule.Should().NotBeNull(); + createdPolicyRule.Name.Should().Be(defaultPolicyRule.Name); + createdPolicyRule.Type.Should().Be(PolicyType.ProfileEnrollment.ToString()); + createdPolicyRule.Actions.Should().NotBeNull(); + createdPolicyRule.Actions.ProfileEnrollment.Should().NotBeNull(); + createdPolicyRule.Actions.ProfileEnrollment.Access.Should().Be("ALLOW"); + createdPolicyRule.Actions.ProfileEnrollment.PreRegistrationInlineHooks.Should().BeNullOrEmpty(); + createdPolicyRule.Actions.ProfileEnrollment.UnknownUserAction.Should().Be("DENY"); + createdPolicyRule.Actions.ProfileEnrollment.TargetGroupIds.Should().BeNullOrEmpty(); + createdPolicyRule.Actions.ProfileEnrollment.ActivationRequirements.EmailVerification.Should().BeTrue(); + createdPolicyRule.Actions.ProfileEnrollment.ProfileAttributes.Should().HaveCount(1); + createdPolicyRule.Actions.ProfileEnrollment.ProfileAttributes.First().Name.Should().Be("email"); + createdPolicyRule.Actions.ProfileEnrollment.ProfileAttributes.First().Label.Should().Be("Email"); + createdPolicyRule.Actions.ProfileEnrollment.ProfileAttributes.First().Required.Should().BeTrue(); + } + finally + { + await client.Policies.DeletePolicyAsync(createdPolicy.Id); + } + } + [Fact] public async Task CreateOktaSignOnOnPremPolicyRule() { diff --git a/src/Okta.Sdk.IntegrationTests/UserScenarios.cs b/src/Okta.Sdk.IntegrationTests/UserScenarios.cs index 490c35ef7..03d7bae98 100644 --- a/src/Okta.Sdk.IntegrationTests/UserScenarios.cs +++ b/src/Okta.Sdk.IntegrationTests/UserScenarios.cs @@ -141,7 +141,6 @@ public async Task CreateUserWithPasswordImportInlineHookOptions() userRetrievedById.Profile.LastName.Should().Be("CreateUserWithPasswordImportInlineHookOptions"); userRetrievedById.Credentials.Provider.Type.Should().Be(AuthenticationProviderType.Import); userRetrievedById.Credentials.Provider.Name.Should().Be("IMPORT"); - } finally { @@ -935,7 +934,7 @@ public async Task ExpirePasswordAndGetTemporaryPassword() await createdUser.DeactivateOrDeleteAsync(); } } - + [Fact] public async Task GetLinkedObjectForUser() { diff --git a/src/Okta.Sdk.UnitTests/Assets/org_logo.png b/src/Okta.Sdk.UnitTests/Assets/org_logo.png new file mode 100644 index 000000000..45f9dcf41 Binary files /dev/null and b/src/Okta.Sdk.UnitTests/Assets/org_logo.png differ diff --git a/src/Okta.Sdk.UnitTests/BrandsClientShould.cs b/src/Okta.Sdk.UnitTests/BrandsClientShould.cs new file mode 100644 index 000000000..7b211b135 --- /dev/null +++ b/src/Okta.Sdk.UnitTests/BrandsClientShould.cs @@ -0,0 +1,64 @@ +// +// 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.IO; +using System.Text; +using System.Threading.Tasks; +using FluentAssertions; +using Okta.Sdk.UnitTests.Internal; +using Xunit; + +namespace Okta.Sdk.UnitTests +{ + public class BrandsClientShould + { + [Fact] + public async Task UploadThemeLogo() + { + var rawResponse = @"{ ""url"": ""foo"" }"; + var mockRequestExecutor = new MockedStringRequestExecutor(rawResponse); + var client = new TestableOktaClient(mockRequestExecutor); + var filePath = Path.Combine(Directory.GetCurrentDirectory(), "Assets/org_logo.png"); + var file = File.OpenRead(filePath); + var response = await client.Brands.UploadBrandThemeLogoAsync(file, "brandId", "themeId"); + + mockRequestExecutor.ReceivedHref.Should().Be("/api/v1/brands/brandId/themes/themeId/logo"); + mockRequestExecutor.ReceivedBody.Should().NotBeNullOrEmpty(); + response.Url.Should().Be("foo"); + } + + [Fact] + public async Task UploadThemeFavicon() + { + var rawResponse = @"{ ""url"": ""foo"" }"; + var mockRequestExecutor = new MockedStringRequestExecutor(rawResponse); + var client = new TestableOktaClient(mockRequestExecutor); + var filePath = Path.Combine(Directory.GetCurrentDirectory(), "Assets/org_logo.png"); + var file = File.OpenRead(filePath); + var response = await client.Brands.UploadBrandThemeFaviconAsync(file, "brandId", "themeId"); + + mockRequestExecutor.ReceivedHref.Should().Be("/api/v1/brands/brandId/themes/themeId/favicon"); + mockRequestExecutor.ReceivedBody.Should().NotBeNullOrEmpty(); + response.Url.Should().Be("foo"); + } + + [Fact] + public async Task UploadThemeBackgroundImage() + { + var rawResponse = @"{ ""url"": ""foo"" }"; + var mockRequestExecutor = new MockedStringRequestExecutor(rawResponse); + var client = new TestableOktaClient(mockRequestExecutor); + var filePath = Path.Combine(Directory.GetCurrentDirectory(), "Assets/org_logo.png"); + var file = File.OpenRead(filePath); + var response = await client.Brands.UploadBrandThemeBackgroundImageAsync(file, "brandId", "themeId"); + + mockRequestExecutor.ReceivedHref.Should().Be("/api/v1/brands/brandId/themes/themeId/background-image"); + mockRequestExecutor.ReceivedBody.Should().NotBeNullOrEmpty(); + response.Url.Should().Be("foo"); + } + } +} diff --git a/src/Okta.Sdk.UnitTests/HttpRequestShould.cs b/src/Okta.Sdk.UnitTests/HttpRequestShould.cs index ea997446a..e4aca7717 100644 --- a/src/Okta.Sdk.UnitTests/HttpRequestShould.cs +++ b/src/Okta.Sdk.UnitTests/HttpRequestShould.cs @@ -3,12 +3,11 @@ // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. // +using System.Net.Http; using FluentAssertions; using NSubstitute; using Okta.Sdk.Internal; using Okta.Sdk.UnitTests.Internal; -using System.Net.Http; -using System.Threading.Tasks; using Xunit; namespace Okta.Sdk.UnitTests diff --git a/src/Okta.Sdk.UnitTests/Internal/TestHttpMultipartRequest.cs b/src/Okta.Sdk.UnitTests/Internal/TestHttpMultipartRequest.cs new file mode 100644 index 000000000..72a67db2c --- /dev/null +++ b/src/Okta.Sdk.UnitTests/Internal/TestHttpMultipartRequest.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Okta.Sdk.Internal; + +namespace Okta.Sdk.UnitTests.Internal +{ + public class TestHttpMultipartRequest : MultipartHttpRequest + { + public IPayloadHandler GetPayloadHandler() + { + return PayloadHandler; + } + } +} diff --git a/src/Okta.Sdk.UnitTests/Okta.Sdk.UnitTests.csproj b/src/Okta.Sdk.UnitTests/Okta.Sdk.UnitTests.csproj index 32fcc7171..7cc9c1590 100644 --- a/src/Okta.Sdk.UnitTests/Okta.Sdk.UnitTests.csproj +++ b/src/Okta.Sdk.UnitTests/Okta.Sdk.UnitTests.csproj @@ -33,6 +33,9 @@ + + PreserveNewest + PreserveNewest diff --git a/src/Okta.Sdk.UnitTests/OrgsClientShould.cs b/src/Okta.Sdk.UnitTests/OrgsClientShould.cs new file mode 100644 index 000000000..1dd43f399 --- /dev/null +++ b/src/Okta.Sdk.UnitTests/OrgsClientShould.cs @@ -0,0 +1,25 @@ +using System.IO; +using System.Threading.Tasks; +using FluentAssertions; +using NSubstitute; +using Okta.Sdk.UnitTests.Internal; +using Xunit; + +namespace Okta.Sdk.UnitTests +{ + public class OrgsClientShould + { + [Fact] + public async Task UpdateOrgLogo() + { + var rawResponse = "{}"; + var mockRequestExecutor = new MockedStringRequestExecutor(rawResponse); + var client = new TestableOktaClient(mockRequestExecutor); + var filePath = Path.Combine(Directory.GetCurrentDirectory(), "Assets/org_logo.png"); + var file = File.OpenRead(filePath); + await client.Orgs.UpdateOrgLogoAsync(file); + + mockRequestExecutor.ReceivedHref.Should().Be("/api/v1/org/logo"); + } + } +} diff --git a/src/Okta.Sdk.UnitTests/PayloadHandlerShould.cs b/src/Okta.Sdk.UnitTests/PayloadHandlerShould.cs index 0a7c181bc..6b57b4762 100644 --- a/src/Okta.Sdk.UnitTests/PayloadHandlerShould.cs +++ b/src/Okta.Sdk.UnitTests/PayloadHandlerShould.cs @@ -106,6 +106,27 @@ public void SetPkixCertContent() httpRequestMessage.Content.Headers.ContentType.ToString().Should().Be("application/pkix-cert; charset=utf-8"); } + [Fact] + public void SetMultipartFormDataContent() + { + var payloadHandler = new MultipartFormDataPayloadHandler(); + PayloadHandler.TryRegister(payloadHandler); + var testHttpRequest = new TestHttpMultipartRequest + { + ContentType = "multipart/form-data", // this must match the ContentType of the MultipartFormDataPayloadHandler for this test + Payload = new byte[256], + FileName = "foo.png", + }; + testHttpRequest.GetPayloadHandler().GetType().Should().Be(typeof(MultipartFormDataPayloadHandler)); + + var httpRequestMessage = new HttpRequestMessage(); + payloadHandler.SetHttpRequestMessageContent(testHttpRequest, httpRequestMessage); + httpRequestMessage.Content.Should().NotBeNull(); + httpRequestMessage.Content.GetType().Should().Be(typeof(MultipartFormDataContent)); + httpRequestMessage.Content.Headers.Contains("Content-Type"); + httpRequestMessage.Content.Headers.ContentType.ToString().Should().Contain("multipart/form-data"); + } + [Fact] public void SetPemCertContent() { diff --git a/src/Okta.Sdk/Application.cs b/src/Okta.Sdk/Application.cs new file mode 100644 index 000000000..b6786c8f7 --- /dev/null +++ b/src/Okta.Sdk/Application.cs @@ -0,0 +1,22 @@ +// +// 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.Linq; + +namespace Okta.Sdk +{ + /// + public partial class Application : IApplication + { + /// + public string GetAccessPolicyId() => + + this.GetProperty("_links")? + .GetProperty("accessPolicy")? + .GetProperty("href")? + .Split('/')? + .LastOrDefault(); + } +} diff --git a/src/Okta.Sdk/BrandsClient.cs b/src/Okta.Sdk/BrandsClient.cs new file mode 100644 index 000000000..b93a18bfc --- /dev/null +++ b/src/Okta.Sdk/BrandsClient.cs @@ -0,0 +1,85 @@ +// +// 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.Collections.Generic; +using System.IO; +using System.Threading; +using System.Threading.Tasks; + +namespace Okta.Sdk +{ + /// + public sealed partial class BrandsClient : OktaClient, IBrandsClient + { + /// + public async Task UploadBrandThemeLogoAsync(FileStream file, string brandId, string themeId, CancellationToken cancellationToken = default) + { + byte[] fileBytes = new byte[file.Length]; + await file.ReadAsync(fileBytes, 0, (int)file.Length, cancellationToken).ConfigureAwait(false); + + var request = new MultipartHttpRequest + { + Uri = "/api/v1/brands/{brandId}/themes/{themeId}/logo", + Payload = fileBytes, + ContentType = "multipart/form-data", + Verb = HttpVerb.Post, + FileName = file.Name, + PathParameters = new Dictionary() + { + ["brandId"] = brandId, + ["themeId"] = themeId, + }, + }; + + return await PostAsync(request, cancellationToken).ConfigureAwait(false); + } + + /// + public async Task UploadBrandThemeFaviconAsync(FileStream file, string brandId, string themeId, CancellationToken cancellationToken = default) + { + byte[] fileBytes = new byte[file.Length]; + await file.ReadAsync(fileBytes, 0, (int)file.Length, cancellationToken).ConfigureAwait(false); + + var request = new MultipartHttpRequest + { + Uri = "/api/v1/brands/{brandId}/themes/{themeId}/favicon", + Payload = fileBytes, + ContentType = "multipart/form-data", + Verb = HttpVerb.Post, + FileName = file.Name, + PathParameters = new Dictionary() + { + ["brandId"] = brandId, + ["themeId"] = themeId, + }, + }; + + return await PostAsync(request, cancellationToken).ConfigureAwait(false); + } + + /// + public async Task UploadBrandThemeBackgroundImageAsync(FileStream file, string brandId, string themeId, CancellationToken cancellationToken = default) + { + byte[] fileBytes = new byte[file.Length]; + await file.ReadAsync(fileBytes, 0, (int)file.Length, cancellationToken).ConfigureAwait(false); + + var request = new MultipartHttpRequest + { + Uri = "/api/v1/brands/{brandId}/themes/{themeId}/background-image", + Payload = fileBytes, + ContentType = "multipart/form-data", + Verb = HttpVerb.Post, + FileName = file.Name, + PathParameters = new Dictionary() + { + ["brandId"] = brandId, + ["themeId"] = themeId, + }, + }; + + return await PostAsync(request, cancellationToken).ConfigureAwait(false); + } + } +} diff --git a/src/Okta.Sdk/Generated/AccessPolicy.Generated.cs b/src/Okta.Sdk/Generated/AccessPolicy.Generated.cs new file mode 100644 index 000000000..a05a7f493 --- /dev/null +++ b/src/Okta.Sdk/Generated/AccessPolicy.Generated.cs @@ -0,0 +1,20 @@ +// +// 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 AccessPolicy : Policy, IAccessPolicy + { + } +} diff --git a/src/Okta.Sdk/Generated/AccessPolicyConstraint.Generated.cs b/src/Okta.Sdk/Generated/AccessPolicyConstraint.Generated.cs new file mode 100644 index 000000000..dfd45d14b --- /dev/null +++ b/src/Okta.Sdk/Generated/AccessPolicyConstraint.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 partial class AccessPolicyConstraint : Resource, IAccessPolicyConstraint + { + /// + public IList Methods + { + get => GetArrayProperty("methods"); + set => this["methods"] = value; + } + + /// + public string ReauthenticateIn + { + get => GetStringProperty("reauthenticateIn"); + set => this["reauthenticateIn"] = value; + } + + /// + public IList Types + { + get => GetArrayProperty("types"); + set => this["types"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/AccessPolicyConstraints.Generated.cs b/src/Okta.Sdk/Generated/AccessPolicyConstraints.Generated.cs new file mode 100644 index 000000000..a607c5801 --- /dev/null +++ b/src/Okta.Sdk/Generated/AccessPolicyConstraints.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 AccessPolicyConstraints : Resource, IAccessPolicyConstraints + { + /// + public IKnowledgeConstraint Knowledge + { + get => GetResourceProperty("knowledge"); + set => this["knowledge"] = value; + } + + /// + public IPossessionConstraint Possession + { + get => GetResourceProperty("possession"); + set => this["possession"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/AccessPolicyRule.Generated.cs b/src/Okta.Sdk/Generated/AccessPolicyRule.Generated.cs new file mode 100644 index 000000000..e06e1797c --- /dev/null +++ b/src/Okta.Sdk/Generated/AccessPolicyRule.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 AccessPolicyRule : PolicyRule, IAccessPolicyRule + { + /// + public IAccessPolicyRuleActions Actions + { + get => GetResourceProperty("actions"); + set => this["actions"] = value; + } + + /// + public IAccessPolicyRuleConditions Conditions + { + get => GetResourceProperty("conditions"); + set => this["conditions"] = value; + } + + /// + public string Name + { + get => GetStringProperty("name"); + set => this["name"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/AccessPolicyRuleActions.Generated.cs b/src/Okta.Sdk/Generated/AccessPolicyRuleActions.Generated.cs new file mode 100644 index 000000000..09b9984d7 --- /dev/null +++ b/src/Okta.Sdk/Generated/AccessPolicyRuleActions.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 AccessPolicyRuleActions : PolicyRuleActions, IAccessPolicyRuleActions + { + /// + public IAccessPolicyRuleApplicationSignOn AppSignOn + { + get => GetResourceProperty("appSignOn"); + set => this["appSignOn"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/AccessPolicyRuleApplicationSignOn.Generated.cs b/src/Okta.Sdk/Generated/AccessPolicyRuleApplicationSignOn.Generated.cs new file mode 100644 index 000000000..c65fd398b --- /dev/null +++ b/src/Okta.Sdk/Generated/AccessPolicyRuleApplicationSignOn.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 AccessPolicyRuleApplicationSignOn : Resource, IAccessPolicyRuleApplicationSignOn + { + /// + public string Access + { + get => GetStringProperty("access"); + set => this["access"] = value; + } + + /// + public IVerificationMethod VerificationMethod + { + get => GetResourceProperty("verificationMethod"); + set => this["verificationMethod"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/AccessPolicyRuleConditions.Generated.cs b/src/Okta.Sdk/Generated/AccessPolicyRuleConditions.Generated.cs new file mode 100644 index 000000000..3d619d812 --- /dev/null +++ b/src/Okta.Sdk/Generated/AccessPolicyRuleConditions.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 AccessPolicyRuleConditions : PolicyRuleConditions, IAccessPolicyRuleConditions + { + /// + public IDeviceAccessPolicyRuleCondition Device + { + get => GetResourceProperty("device"); + set => this["device"] = value; + } + + /// + public IAccessPolicyRuleCustomCondition ElCondition + { + get => GetResourceProperty("elCondition"); + set => this["elCondition"] = value; + } + + /// + public IUserTypeCondition UserType + { + get => GetResourceProperty("userType"); + set => this["userType"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/AccessPolicyRuleCustomCondition.Generated.cs b/src/Okta.Sdk/Generated/AccessPolicyRuleCustomCondition.Generated.cs new file mode 100644 index 000000000..2b74bb22a --- /dev/null +++ b/src/Okta.Sdk/Generated/AccessPolicyRuleCustomCondition.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 AccessPolicyRuleCustomCondition : Resource, IAccessPolicyRuleCustomCondition + { + /// + public string Condition + { + get => GetStringProperty("condition"); + set => this["condition"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/ApplicationCredentialsUsernameTemplate.Generated.cs b/src/Okta.Sdk/Generated/ApplicationCredentialsUsernameTemplate.Generated.cs index 87344d41d..d1905d605 100644 --- a/src/Okta.Sdk/Generated/ApplicationCredentialsUsernameTemplate.Generated.cs +++ b/src/Okta.Sdk/Generated/ApplicationCredentialsUsernameTemplate.Generated.cs @@ -16,6 +16,13 @@ namespace Okta.Sdk /// public sealed partial class ApplicationCredentialsUsernameTemplate : Resource, IApplicationCredentialsUsernameTemplate { + /// + public string PushStatus + { + get => GetStringProperty("pushStatus"); + set => this["pushStatus"] = value; + } + /// public string Suffix { diff --git a/src/Okta.Sdk/Generated/ApplicationVisibility.Generated.cs b/src/Okta.Sdk/Generated/ApplicationVisibility.Generated.cs index ed312f5d3..4748b814a 100644 --- a/src/Okta.Sdk/Generated/ApplicationVisibility.Generated.cs +++ b/src/Okta.Sdk/Generated/ApplicationVisibility.Generated.cs @@ -16,6 +16,13 @@ namespace Okta.Sdk /// public sealed partial class ApplicationVisibility : Resource, IApplicationVisibility { + /// + public bool? AutoLaunch + { + get => GetBooleanProperty("autoLaunch"); + set => this["autoLaunch"] = value; + } + /// public bool? AutoSubmitToolbar { diff --git a/src/Okta.Sdk/Generated/Authenticator.Generated.cs b/src/Okta.Sdk/Generated/Authenticator.Generated.cs index dba0c7400..ade4774fa 100644 --- a/src/Okta.Sdk/Generated/Authenticator.Generated.cs +++ b/src/Okta.Sdk/Generated/Authenticator.Generated.cs @@ -39,6 +39,13 @@ public string Name set => this["name"] = value; } + /// + public IAuthenticatorProvider Provider + { + get => GetResourceProperty("provider"); + set => this["provider"] = value; + } + /// public IAuthenticatorSettings Settings { diff --git a/src/Okta.Sdk/Generated/AuthenticatorProvider.Generated.cs b/src/Okta.Sdk/Generated/AuthenticatorProvider.Generated.cs new file mode 100644 index 000000000..c95568d43 --- /dev/null +++ b/src/Okta.Sdk/Generated/AuthenticatorProvider.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 AuthenticatorProvider : Resource, IAuthenticatorProvider + { + /// + public IAuthenticatorProviderConfiguration Configuration + { + get => GetResourceProperty("configuration"); + set => this["configuration"] = value; + } + + /// + public string Type + { + get => GetStringProperty("type"); + set => this["type"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/AuthenticatorProviderConfiguration.Generated.cs b/src/Okta.Sdk/Generated/AuthenticatorProviderConfiguration.Generated.cs new file mode 100644 index 000000000..4fdf65d73 --- /dev/null +++ b/src/Okta.Sdk/Generated/AuthenticatorProviderConfiguration.Generated.cs @@ -0,0 +1,55 @@ +// +// 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 AuthenticatorProviderConfiguration : Resource, IAuthenticatorProviderConfiguration + { + /// + public int? AuthPort + { + get => GetIntegerProperty("authPort"); + set => this["authPort"] = value; + } + + /// + public string HostName + { + get => GetStringProperty("hostName"); + set => this["hostName"] = value; + } + + /// + public string InstanceId + { + get => GetStringProperty("instanceId"); + set => this["instanceId"] = value; + } + + /// + public string SharedSecret + { + get => GetStringProperty("sharedSecret"); + set => this["sharedSecret"] = value; + } + + /// + public IAuthenticatorProviderConfigurationUserNameTemplate UserNameTemplate + { + get => GetResourceProperty("userNameTemplate"); + set => this["userNameTemplate"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/AuthenticatorProviderConfigurationUserNameTemplate.Generated.cs b/src/Okta.Sdk/Generated/AuthenticatorProviderConfigurationUserNameTemplate.Generated.cs new file mode 100644 index 000000000..361d1995c --- /dev/null +++ b/src/Okta.Sdk/Generated/AuthenticatorProviderConfigurationUserNameTemplate.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 AuthenticatorProviderConfigurationUserNameTemplate : Resource, IAuthenticatorProviderConfigurationUserNameTemplate + { + /// + public string Template + { + get => GetStringProperty("template"); + set => this["template"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/AuthenticatorSettings.Generated.cs b/src/Okta.Sdk/Generated/AuthenticatorSettings.Generated.cs index a6817e218..7626a5293 100644 --- a/src/Okta.Sdk/Generated/AuthenticatorSettings.Generated.cs +++ b/src/Okta.Sdk/Generated/AuthenticatorSettings.Generated.cs @@ -23,6 +23,27 @@ public AllowedForEnum AllowedFor set => this["allowedFor"] = value; } + /// + public string AppInstanceId + { + get => GetStringProperty("appInstanceId"); + set => this["appInstanceId"] = value; + } + + /// + public IChannelBinding ChannelBinding + { + get => GetResourceProperty("channelBinding"); + set => this["channelBinding"] = value; + } + + /// + public ICompliance Compliance + { + get => GetResourceProperty("compliance"); + set => this["compliance"] = value; + } + /// public int? TokenLifetimeInMinutes { @@ -30,5 +51,12 @@ public int? TokenLifetimeInMinutes set => this["tokenLifetimeInMinutes"] = value; } + /// + public UserVerificationEnum UserVerification + { + get => GetEnumProperty("userVerification"); + set => this["userVerification"] = value; + } + } } diff --git a/src/Okta.Sdk/Generated/AuthenticatorType.Generated.cs b/src/Okta.Sdk/Generated/AuthenticatorType.Generated.cs index 8bd4bd287..30fa3e948 100644 --- a/src/Okta.Sdk/Generated/AuthenticatorType.Generated.cs +++ b/src/Okta.Sdk/Generated/AuthenticatorType.Generated.cs @@ -30,6 +30,9 @@ public sealed class AuthenticatorType : StringEnum /// The security_key AuthenticatorType. public static AuthenticatorType SecurityKey = new AuthenticatorType("security_key"); + /// The federated AuthenticatorType. + public static AuthenticatorType Federated = new AuthenticatorType("federated"); + /// /// Implicit operator declaration to accept and convert a string value as a /// diff --git a/src/Okta.Sdk/Generated/AuthenticatorsClient.Generated.cs b/src/Okta.Sdk/Generated/AuthenticatorsClient.Generated.cs index 192f5ac52..83b45dc12 100644 --- a/src/Okta.Sdk/Generated/AuthenticatorsClient.Generated.cs +++ b/src/Okta.Sdk/Generated/AuthenticatorsClient.Generated.cs @@ -50,6 +50,19 @@ public ICollectionClient ListAuthenticators() }, }, cancellationToken).ConfigureAwait(false); + /// + public async Task UpdateAuthenticatorAsync(IAuthenticator authenticator, string authenticatorId, CancellationToken cancellationToken = default(CancellationToken)) + => await PutAsync(new HttpRequest + { + Uri = "/api/v1/authenticators/{authenticatorId}", + Verb = HttpVerb.Put, + Payload = authenticator, + PathParameters = new Dictionary() + { + ["authenticatorId"] = authenticatorId, + }, + }, cancellationToken).ConfigureAwait(false); + /// public async Task ActivateAuthenticatorAsync(string authenticatorId, CancellationToken cancellationToken = default(CancellationToken)) => await PostAsync(new HttpRequest diff --git a/src/Okta.Sdk/Generated/Brand.Generated.cs b/src/Okta.Sdk/Generated/Brand.Generated.cs new file mode 100644 index 000000000..1026cf8b2 --- /dev/null +++ b/src/Okta.Sdk/Generated/Brand.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 Brand : Resource, IBrand + { + /// + public bool? AgreeToCustomPrivacyPolicy + { + get => GetBooleanProperty("agreeToCustomPrivacyPolicy"); + set => this["agreeToCustomPrivacyPolicy"] = value; + } + + /// + public string CustomPrivacyPolicyUrl + { + get => GetStringProperty("customPrivacyPolicyUrl"); + set => this["customPrivacyPolicyUrl"] = value; + } + + /// + public string Id => GetStringProperty("id"); + + /// + public bool? RemovePoweredByOkta + { + get => GetBooleanProperty("removePoweredByOkta"); + set => this["removePoweredByOkta"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/BrandsClient.Generated.cs b/src/Okta.Sdk/Generated/BrandsClient.Generated.cs new file mode 100644 index 000000000..b886fe8af --- /dev/null +++ b/src/Okta.Sdk/Generated/BrandsClient.Generated.cs @@ -0,0 +1,150 @@ +// +// 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 BrandsClient : OktaClient, IBrandsClient + { + // Remove parameterless constructor + private BrandsClient() + { + } + + internal BrandsClient(IDataStore dataStore, OktaClientConfiguration configuration, RequestContext requestContext) + : base(dataStore, configuration, requestContext) + { + } + + /// + public ICollectionClient ListBrands() + => GetCollectionClient(new HttpRequest + { + Uri = "/api/v1/brands", + Verb = HttpVerb.Get, + + }); + + /// + public async Task GetBrandAsync(string brandId, CancellationToken cancellationToken = default(CancellationToken)) + => await GetAsync(new HttpRequest + { + Uri = "/api/v1/brands/{brandId}", + Verb = HttpVerb.Get, + + PathParameters = new Dictionary() + { + ["brandId"] = brandId, + }, + }, cancellationToken).ConfigureAwait(false); + + /// + public async Task UpdateBrandAsync(IBrand brand, string brandId, CancellationToken cancellationToken = default(CancellationToken)) + => await PutAsync(new HttpRequest + { + Uri = "/api/v1/brands/{brandId}", + Verb = HttpVerb.Put, + Payload = brand, + PathParameters = new Dictionary() + { + ["brandId"] = brandId, + }, + }, cancellationToken).ConfigureAwait(false); + + /// + public ICollectionClient ListBrandThemes(string brandId) + => GetCollectionClient(new HttpRequest + { + Uri = "/api/v1/brands/{brandId}/themes", + Verb = HttpVerb.Get, + + PathParameters = new Dictionary() + { + ["brandId"] = brandId, + }, + }); + + /// + public async Task GetBrandThemeAsync(string brandId, string themeId, CancellationToken cancellationToken = default(CancellationToken)) + => await GetAsync(new HttpRequest + { + Uri = "/api/v1/brands/{brandId}/themes/{themeId}", + Verb = HttpVerb.Get, + + PathParameters = new Dictionary() + { + ["brandId"] = brandId, + ["themeId"] = themeId, + }, + }, cancellationToken).ConfigureAwait(false); + + /// + public async Task UpdateBrandThemeAsync(ITheme theme, string brandId, string themeId, CancellationToken cancellationToken = default(CancellationToken)) + => await PutAsync(new HttpRequest + { + Uri = "/api/v1/brands/{brandId}/themes/{themeId}", + Verb = HttpVerb.Put, + Payload = theme, + PathParameters = new Dictionary() + { + ["brandId"] = brandId, + ["themeId"] = themeId, + }, + }, cancellationToken).ConfigureAwait(false); + + /// + public async Task DeleteBrandThemeBackgroundImageAsync(string brandId, string themeId, CancellationToken cancellationToken = default(CancellationToken)) + => await DeleteAsync(new HttpRequest + { + Uri = "/api/v1/brands/{brandId}/themes/{themeId}/background-image", + Verb = HttpVerb.Delete, + + PathParameters = new Dictionary() + { + ["brandId"] = brandId, + ["themeId"] = themeId, + }, + }, cancellationToken).ConfigureAwait(false); + + /// + public async Task DeleteBrandThemeFaviconAsync(string brandId, string themeId, CancellationToken cancellationToken = default(CancellationToken)) + => await DeleteAsync(new HttpRequest + { + Uri = "/api/v1/brands/{brandId}/themes/{themeId}/favicon", + Verb = HttpVerb.Delete, + + PathParameters = new Dictionary() + { + ["brandId"] = brandId, + ["themeId"] = themeId, + }, + }, cancellationToken).ConfigureAwait(false); + + /// + public async Task DeleteBrandThemeLogoAsync(string brandId, string themeId, CancellationToken cancellationToken = default(CancellationToken)) + => await DeleteAsync(new HttpRequest + { + Uri = "/api/v1/brands/{brandId}/themes/{themeId}/logo", + Verb = HttpVerb.Delete, + + PathParameters = new Dictionary() + { + ["brandId"] = brandId, + ["themeId"] = themeId, + }, + }, cancellationToken).ConfigureAwait(false); + + } +} diff --git a/src/Okta.Sdk/Generated/ChannelBinding.Generated.cs b/src/Okta.Sdk/Generated/ChannelBinding.Generated.cs new file mode 100644 index 000000000..ae6e82947 --- /dev/null +++ b/src/Okta.Sdk/Generated/ChannelBinding.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 ChannelBinding : Resource, IChannelBinding + { + /// + public RequiredEnum Required + { + get => GetEnumProperty("required"); + set => this["required"] = value; + } + + /// + public string Style + { + get => GetStringProperty("style"); + set => this["style"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/Compliance.Generated.cs b/src/Okta.Sdk/Generated/Compliance.Generated.cs new file mode 100644 index 000000000..2ee081bc8 --- /dev/null +++ b/src/Okta.Sdk/Generated/Compliance.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 Compliance : Resource, ICompliance + { + /// + public FipsEnum Fips + { + get => GetEnumProperty("fips"); + set => this["fips"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/DeviceAccessPolicyRuleCondition.Generated.cs b/src/Okta.Sdk/Generated/DeviceAccessPolicyRuleCondition.Generated.cs new file mode 100644 index 000000000..6206fac73 --- /dev/null +++ b/src/Okta.Sdk/Generated/DeviceAccessPolicyRuleCondition.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 DeviceAccessPolicyRuleCondition : DevicePolicyRuleCondition, IDeviceAccessPolicyRuleCondition + { + /// + public bool? Managed + { + get => GetBooleanProperty("managed"); + set => this["managed"] = value; + } + + /// + public bool? Registered + { + get => GetBooleanProperty("registered"); + set => this["registered"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/DevicePolicyRuleCondition.Generated.cs b/src/Okta.Sdk/Generated/DevicePolicyRuleCondition.Generated.cs index e22659c6a..486a8cdf5 100644 --- a/src/Okta.Sdk/Generated/DevicePolicyRuleCondition.Generated.cs +++ b/src/Okta.Sdk/Generated/DevicePolicyRuleCondition.Generated.cs @@ -14,7 +14,7 @@ namespace Okta.Sdk { /// - public sealed partial class DevicePolicyRuleCondition : Resource, IDevicePolicyRuleCondition + public partial class DevicePolicyRuleCondition : Resource, IDevicePolicyRuleCondition { /// public bool? Migrated diff --git a/src/Okta.Sdk/Generated/EmailTemplateTouchPointVariant.Generated.cs b/src/Okta.Sdk/Generated/EmailTemplateTouchPointVariant.Generated.cs new file mode 100644 index 000000000..74df0422e --- /dev/null +++ b/src/Okta.Sdk/Generated/EmailTemplateTouchPointVariant.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 EmailTemplateTouchPointVariant values in the Okta API. + /// + public sealed class EmailTemplateTouchPointVariant : StringEnum + { + /// The OKTA_DEFAULT EmailTemplateTouchPointVariant. + public static EmailTemplateTouchPointVariant OktaDefault = new EmailTemplateTouchPointVariant("OKTA_DEFAULT"); + + /// The FULL_THEME EmailTemplateTouchPointVariant. + public static EmailTemplateTouchPointVariant FullTheme = new EmailTemplateTouchPointVariant("FULL_THEME"); + + /// + /// Implicit operator declaration to accept and convert a string value as a + /// + /// The value to use + public static implicit operator EmailTemplateTouchPointVariant(string value) => new EmailTemplateTouchPointVariant(value); + + /// + /// Creates a new instance. + /// + /// The value to use. + public EmailTemplateTouchPointVariant(string value) + : base(value) + { + } + + } +} diff --git a/src/Okta.Sdk/Generated/EndUserDashboardTouchPointVariant.Generated.cs b/src/Okta.Sdk/Generated/EndUserDashboardTouchPointVariant.Generated.cs new file mode 100644 index 000000000..73ec2d294 --- /dev/null +++ b/src/Okta.Sdk/Generated/EndUserDashboardTouchPointVariant.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 EndUserDashboardTouchPointVariant values in the Okta API. + /// + public sealed class EndUserDashboardTouchPointVariant : StringEnum + { + /// The OKTA_DEFAULT EndUserDashboardTouchPointVariant. + public static EndUserDashboardTouchPointVariant OktaDefault = new EndUserDashboardTouchPointVariant("OKTA_DEFAULT"); + + /// The WHITE_LOGO_BACKGROUND EndUserDashboardTouchPointVariant. + public static EndUserDashboardTouchPointVariant WhiteLogoBackground = new EndUserDashboardTouchPointVariant("WHITE_LOGO_BACKGROUND"); + + /// The FULL_THEME EndUserDashboardTouchPointVariant. + public static EndUserDashboardTouchPointVariant FullTheme = new EndUserDashboardTouchPointVariant("FULL_THEME"); + + /// The LOGO_ON_FULL_WHITE_BACKGROUND EndUserDashboardTouchPointVariant. + public static EndUserDashboardTouchPointVariant LogoOnFullWhiteBackground = new EndUserDashboardTouchPointVariant("LOGO_ON_FULL_WHITE_BACKGROUND"); + + /// + /// Implicit operator declaration to accept and convert a string value as a + /// + /// The value to use + public static implicit operator EndUserDashboardTouchPointVariant(string value) => new EndUserDashboardTouchPointVariant(value); + + /// + /// Creates a new instance. + /// + /// The value to use. + public EndUserDashboardTouchPointVariant(string value) + : base(value) + { + } + + } +} diff --git a/src/Okta.Sdk/Generated/ErrorPageTouchPointVariant.Generated.cs b/src/Okta.Sdk/Generated/ErrorPageTouchPointVariant.Generated.cs new file mode 100644 index 000000000..d6232c807 --- /dev/null +++ b/src/Okta.Sdk/Generated/ErrorPageTouchPointVariant.Generated.cs @@ -0,0 +1,40 @@ +// +// 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 ErrorPageTouchPointVariant values in the Okta API. + /// + public sealed class ErrorPageTouchPointVariant : StringEnum + { + /// The OKTA_DEFAULT ErrorPageTouchPointVariant. + public static ErrorPageTouchPointVariant OktaDefault = new ErrorPageTouchPointVariant("OKTA_DEFAULT"); + + /// The BACKGROUND_SECONDARY_COLOR ErrorPageTouchPointVariant. + public static ErrorPageTouchPointVariant BackgroundSecondaryColor = new ErrorPageTouchPointVariant("BACKGROUND_SECONDARY_COLOR"); + + /// The BACKGROUND_IMAGE ErrorPageTouchPointVariant. + public static ErrorPageTouchPointVariant BackgroundImage = new ErrorPageTouchPointVariant("BACKGROUND_IMAGE"); + + /// + /// Implicit operator declaration to accept and convert a string value as a + /// + /// The value to use + public static implicit operator ErrorPageTouchPointVariant(string value) => new ErrorPageTouchPointVariant(value); + + /// + /// Creates a new instance. + /// + /// The value to use. + public ErrorPageTouchPointVariant(string value) + : base(value) + { + } + + } +} diff --git a/src/Okta.Sdk/Generated/FipsEnum.Generated.cs b/src/Okta.Sdk/Generated/FipsEnum.Generated.cs new file mode 100644 index 000000000..8643a3573 --- /dev/null +++ b/src/Okta.Sdk/Generated/FipsEnum.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 FipsEnum values in the Okta API. + /// + public sealed class FipsEnum : StringEnum + { + /// The REQUIRED FipsEnum. + public static FipsEnum Required = new FipsEnum("REQUIRED"); + + /// The OPTIONAL FipsEnum. + public static FipsEnum Optional = new FipsEnum("OPTIONAL"); + + /// + /// Implicit operator declaration to accept and convert a string value as a + /// + /// The value to use + public static implicit operator FipsEnum(string value) => new FipsEnum(value); + + /// + /// Creates a new instance. + /// + /// The value to use. + public FipsEnum(string value) + : base(value) + { + } + + } +} diff --git a/src/Okta.Sdk/Generated/Group.Generated.cs b/src/Okta.Sdk/Generated/Group.Generated.cs index 2bf81ca53..3b86f322b 100644 --- a/src/Okta.Sdk/Generated/Group.Generated.cs +++ b/src/Okta.Sdk/Generated/Group.Generated.cs @@ -53,7 +53,7 @@ public ICollectionClient ListApplications( /// public Task AssignRoleAsync(IAssignRoleRequest assignRoleRequest, - string disableNotifications = null, CancellationToken cancellationToken = default(CancellationToken)) + bool? disableNotifications = null, CancellationToken cancellationToken = default(CancellationToken)) => GetClient().Groups.AssignRoleToGroupAsync(assignRoleRequest, Id, disableNotifications, cancellationToken); } diff --git a/src/Okta.Sdk/Generated/GroupsClient.Generated.cs b/src/Okta.Sdk/Generated/GroupsClient.Generated.cs index 358b021f6..f2d16f10a 100644 --- a/src/Okta.Sdk/Generated/GroupsClient.Generated.cs +++ b/src/Okta.Sdk/Generated/GroupsClient.Generated.cs @@ -227,7 +227,7 @@ public ICollectionClient ListGroupAssignedRoles(string groupId, string ex }); /// - public async Task AssignRoleToGroupAsync(IAssignRoleRequest assignRoleRequest, string groupId, string disableNotifications = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task AssignRoleToGroupAsync(IAssignRoleRequest assignRoleRequest, string groupId, bool? disableNotifications = null, CancellationToken cancellationToken = default(CancellationToken)) => await PostAsync(new HttpRequest { Uri = "/api/v1/groups/{groupId}/roles", diff --git a/src/Okta.Sdk/Generated/IAccessPolicy.Generated.cs b/src/Okta.Sdk/Generated/IAccessPolicy.Generated.cs new file mode 100644 index 000000000..9db6dfce3 --- /dev/null +++ b/src/Okta.Sdk/Generated/IAccessPolicy.Generated.cs @@ -0,0 +1,19 @@ +// +// 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 AccessPolicy resource in the Okta API. + public partial interface IAccessPolicy : IPolicy + { + } +} diff --git a/src/Okta.Sdk/Generated/IAccessPolicyConstraint.Generated.cs b/src/Okta.Sdk/Generated/IAccessPolicyConstraint.Generated.cs new file mode 100644 index 000000000..6bcb9c69a --- /dev/null +++ b/src/Okta.Sdk/Generated/IAccessPolicyConstraint.Generated.cs @@ -0,0 +1,25 @@ +// +// 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 AccessPolicyConstraint resource in the Okta API. + public partial interface IAccessPolicyConstraint : IResource + { + IList Methods { get; set; } + + string ReauthenticateIn { get; set; } + + IList Types { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IAccessPolicyConstraints.Generated.cs b/src/Okta.Sdk/Generated/IAccessPolicyConstraints.Generated.cs new file mode 100644 index 000000000..9d37d02b8 --- /dev/null +++ b/src/Okta.Sdk/Generated/IAccessPolicyConstraints.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 AccessPolicyConstraints resource in the Okta API. + public partial interface IAccessPolicyConstraints : IResource + { + IKnowledgeConstraint Knowledge { get; set; } + + IPossessionConstraint Possession { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IAccessPolicyRule.Generated.cs b/src/Okta.Sdk/Generated/IAccessPolicyRule.Generated.cs new file mode 100644 index 000000000..92fd3bcbb --- /dev/null +++ b/src/Okta.Sdk/Generated/IAccessPolicyRule.Generated.cs @@ -0,0 +1,25 @@ +// +// 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 AccessPolicyRule resource in the Okta API. + public partial interface IAccessPolicyRule : IPolicyRule + { + IAccessPolicyRuleActions Actions { get; set; } + + IAccessPolicyRuleConditions Conditions { get; set; } + + string Name { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IAccessPolicyRuleActions.Generated.cs b/src/Okta.Sdk/Generated/IAccessPolicyRuleActions.Generated.cs new file mode 100644 index 000000000..ac881adef --- /dev/null +++ b/src/Okta.Sdk/Generated/IAccessPolicyRuleActions.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 AccessPolicyRuleActions resource in the Okta API. + public partial interface IAccessPolicyRuleActions : IPolicyRuleActions + { + IAccessPolicyRuleApplicationSignOn AppSignOn { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IAccessPolicyRuleApplicationSignOn.Generated.cs b/src/Okta.Sdk/Generated/IAccessPolicyRuleApplicationSignOn.Generated.cs new file mode 100644 index 000000000..e776d6500 --- /dev/null +++ b/src/Okta.Sdk/Generated/IAccessPolicyRuleApplicationSignOn.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 AccessPolicyRuleApplicationSignOn resource in the Okta API. + public partial interface IAccessPolicyRuleApplicationSignOn : IResource + { + string Access { get; set; } + + IVerificationMethod VerificationMethod { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IAccessPolicyRuleConditions.Generated.cs b/src/Okta.Sdk/Generated/IAccessPolicyRuleConditions.Generated.cs new file mode 100644 index 000000000..8b61ef2b9 --- /dev/null +++ b/src/Okta.Sdk/Generated/IAccessPolicyRuleConditions.Generated.cs @@ -0,0 +1,25 @@ +// +// 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 AccessPolicyRuleConditions resource in the Okta API. + public partial interface IAccessPolicyRuleConditions : IPolicyRuleConditions + { + IDeviceAccessPolicyRuleCondition Device { get; set; } + + IAccessPolicyRuleCustomCondition ElCondition { get; set; } + + IUserTypeCondition UserType { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IAccessPolicyRuleCustomCondition.Generated.cs b/src/Okta.Sdk/Generated/IAccessPolicyRuleCustomCondition.Generated.cs new file mode 100644 index 000000000..85796e49e --- /dev/null +++ b/src/Okta.Sdk/Generated/IAccessPolicyRuleCustomCondition.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 AccessPolicyRuleCustomCondition resource in the Okta API. + public partial interface IAccessPolicyRuleCustomCondition : IResource + { + string Condition { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IApplicationCredentialsUsernameTemplate.Generated.cs b/src/Okta.Sdk/Generated/IApplicationCredentialsUsernameTemplate.Generated.cs index 59e62b4eb..fd99fdb2a 100644 --- a/src/Okta.Sdk/Generated/IApplicationCredentialsUsernameTemplate.Generated.cs +++ b/src/Okta.Sdk/Generated/IApplicationCredentialsUsernameTemplate.Generated.cs @@ -15,6 +15,8 @@ namespace Okta.Sdk /// Represents a ApplicationCredentialsUsernameTemplate resource in the Okta API. public partial interface IApplicationCredentialsUsernameTemplate : IResource { + string PushStatus { get; set; } + string Suffix { get; set; } string Template { get; set; } diff --git a/src/Okta.Sdk/Generated/IApplicationVisibility.Generated.cs b/src/Okta.Sdk/Generated/IApplicationVisibility.Generated.cs index ebf27bcb9..959038b32 100644 --- a/src/Okta.Sdk/Generated/IApplicationVisibility.Generated.cs +++ b/src/Okta.Sdk/Generated/IApplicationVisibility.Generated.cs @@ -15,6 +15,8 @@ namespace Okta.Sdk /// Represents a ApplicationVisibility resource in the Okta API. public partial interface IApplicationVisibility : IResource { + bool? AutoLaunch { get; set; } + bool? AutoSubmitToolbar { get; set; } IApplicationVisibilityHide Hide { get; set; } diff --git a/src/Okta.Sdk/Generated/IAuthenticator.Generated.cs b/src/Okta.Sdk/Generated/IAuthenticator.Generated.cs index f3cd5c071..35bb33985 100644 --- a/src/Okta.Sdk/Generated/IAuthenticator.Generated.cs +++ b/src/Okta.Sdk/Generated/IAuthenticator.Generated.cs @@ -25,6 +25,8 @@ public partial interface IAuthenticator : IResource string Name { get; set; } + IAuthenticatorProvider Provider { get; set; } + IAuthenticatorSettings Settings { get; set; } AuthenticatorStatus Status { get; set; } diff --git a/src/Okta.Sdk/Generated/IAuthenticatorProvider.Generated.cs b/src/Okta.Sdk/Generated/IAuthenticatorProvider.Generated.cs new file mode 100644 index 000000000..23acf3583 --- /dev/null +++ b/src/Okta.Sdk/Generated/IAuthenticatorProvider.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 AuthenticatorProvider resource in the Okta API. + public partial interface IAuthenticatorProvider : IResource + { + IAuthenticatorProviderConfiguration Configuration { get; set; } + + string Type { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IAuthenticatorProviderConfiguration.Generated.cs b/src/Okta.Sdk/Generated/IAuthenticatorProviderConfiguration.Generated.cs new file mode 100644 index 000000000..a53c1ef0c --- /dev/null +++ b/src/Okta.Sdk/Generated/IAuthenticatorProviderConfiguration.Generated.cs @@ -0,0 +1,29 @@ +// +// 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 AuthenticatorProviderConfiguration resource in the Okta API. + public partial interface IAuthenticatorProviderConfiguration : IResource + { + int? AuthPort { get; set; } + + string HostName { get; set; } + + string InstanceId { get; set; } + + string SharedSecret { get; set; } + + IAuthenticatorProviderConfigurationUserNameTemplate UserNameTemplate { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IAuthenticatorProviderConfigurationUserNameTemplate.Generated.cs b/src/Okta.Sdk/Generated/IAuthenticatorProviderConfigurationUserNameTemplate.Generated.cs new file mode 100644 index 000000000..14c590bf3 --- /dev/null +++ b/src/Okta.Sdk/Generated/IAuthenticatorProviderConfigurationUserNameTemplate.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 AuthenticatorProviderConfigurationUserNameTemplate resource in the Okta API. + public partial interface IAuthenticatorProviderConfigurationUserNameTemplate : IResource + { + string Template { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IAuthenticatorSettings.Generated.cs b/src/Okta.Sdk/Generated/IAuthenticatorSettings.Generated.cs index 602910248..82cb1cdec 100644 --- a/src/Okta.Sdk/Generated/IAuthenticatorSettings.Generated.cs +++ b/src/Okta.Sdk/Generated/IAuthenticatorSettings.Generated.cs @@ -17,7 +17,15 @@ public partial interface IAuthenticatorSettings : IResource { AllowedForEnum AllowedFor { get; set; } + string AppInstanceId { get; set; } + + IChannelBinding ChannelBinding { get; set; } + + ICompliance Compliance { get; set; } + int? TokenLifetimeInMinutes { get; set; } + UserVerificationEnum UserVerification { get; set; } + } } diff --git a/src/Okta.Sdk/Generated/IAuthenticatorsClient.Generated.cs b/src/Okta.Sdk/Generated/IAuthenticatorsClient.Generated.cs index e21e47f1f..e8f6bdb70 100644 --- a/src/Okta.Sdk/Generated/IAuthenticatorsClient.Generated.cs +++ b/src/Okta.Sdk/Generated/IAuthenticatorsClient.Generated.cs @@ -29,6 +29,15 @@ public partial interface IAuthenticatorsClient /// The response. Task GetAuthenticatorAsync(string authenticatorId, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates an authenticator + /// + /// The resource. + /// + /// The cancellation token. + /// The response. + Task UpdateAuthenticatorAsync(IAuthenticator authenticator, string authenticatorId, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Success /// diff --git a/src/Okta.Sdk/Generated/IBrand.Generated.cs b/src/Okta.Sdk/Generated/IBrand.Generated.cs new file mode 100644 index 000000000..63d77af1b --- /dev/null +++ b/src/Okta.Sdk/Generated/IBrand.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 Brand resource in the Okta API. + public partial interface IBrand : IResource + { + bool? AgreeToCustomPrivacyPolicy { get; set; } + + string CustomPrivacyPolicyUrl { get; set; } + + string Id { get; } + + bool? RemovePoweredByOkta { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IBrandsClient.Generated.cs b/src/Okta.Sdk/Generated/IBrandsClient.Generated.cs new file mode 100644 index 000000000..d84cfabc6 --- /dev/null +++ b/src/Okta.Sdk/Generated/IBrandsClient.Generated.cs @@ -0,0 +1,95 @@ +// +// 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 Brand resources. + public partial interface IBrandsClient + { + /// + /// List all the brands in your org. + /// + /// A collection of that can be enumerated asynchronously. + ICollectionClient ListBrands(); + + /// + /// Fetches a brand by `brandId` + /// + /// + /// The cancellation token. + /// The response. + Task GetBrandAsync(string brandId, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Updates a brand by `brandId` + /// + /// The resource. + /// + /// The cancellation token. + /// The response. + Task UpdateBrandAsync(IBrand brand, string brandId, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// List all the themes in your brand + /// + /// + /// A collection of that can be enumerated asynchronously. + ICollectionClient ListBrandThemes(string brandId); + + /// + /// Fetches a theme for a brand + /// + /// + /// + /// The cancellation token. + /// The response. + Task GetBrandThemeAsync(string brandId, string themeId, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Updates a theme for a brand + /// + /// The resource. + /// + /// + /// The cancellation token. + /// The response. + Task UpdateBrandThemeAsync(ITheme theme, string brandId, string themeId, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Deletes a Theme background image + /// + /// + /// + /// The cancellation token. + /// A Task that represents the asynchronous operation. + Task DeleteBrandThemeBackgroundImageAsync(string brandId, string themeId, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Deletes a Theme favicon. The org then uses the Okta default favicon. + /// + /// + /// + /// The cancellation token. + /// A Task that represents the asynchronous operation. + Task DeleteBrandThemeFaviconAsync(string brandId, string themeId, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Deletes a Theme logo. The org then uses the Okta default logo. + /// + /// + /// + /// The cancellation token. + /// A Task that represents the asynchronous operation. + Task DeleteBrandThemeLogoAsync(string brandId, string themeId, CancellationToken cancellationToken = default(CancellationToken)); + + } +} diff --git a/src/Okta.Sdk/Generated/IChannelBinding.Generated.cs b/src/Okta.Sdk/Generated/IChannelBinding.Generated.cs new file mode 100644 index 000000000..73a0f0961 --- /dev/null +++ b/src/Okta.Sdk/Generated/IChannelBinding.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 ChannelBinding resource in the Okta API. + public partial interface IChannelBinding : IResource + { + RequiredEnum Required { get; set; } + + string Style { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/ICompliance.Generated.cs b/src/Okta.Sdk/Generated/ICompliance.Generated.cs new file mode 100644 index 000000000..4c3af9bfa --- /dev/null +++ b/src/Okta.Sdk/Generated/ICompliance.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 Compliance resource in the Okta API. + public partial interface ICompliance : IResource + { + FipsEnum Fips { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IDeviceAccessPolicyRuleCondition.Generated.cs b/src/Okta.Sdk/Generated/IDeviceAccessPolicyRuleCondition.Generated.cs new file mode 100644 index 000000000..6ae9b3abb --- /dev/null +++ b/src/Okta.Sdk/Generated/IDeviceAccessPolicyRuleCondition.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 DeviceAccessPolicyRuleCondition resource in the Okta API. + public partial interface IDeviceAccessPolicyRuleCondition : IDevicePolicyRuleCondition + { + bool? Managed { get; set; } + + bool? Registered { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IGroup.Generated.cs b/src/Okta.Sdk/Generated/IGroup.Generated.cs index 975e9581d..7a88a3388 100644 --- a/src/Okta.Sdk/Generated/IGroup.Generated.cs +++ b/src/Okta.Sdk/Generated/IGroup.Generated.cs @@ -36,7 +36,7 @@ ICollectionClient ListApplications( string after = null, int? limit = 20); Task AssignRoleAsync(IAssignRoleRequest assignRoleRequest, - string disableNotifications = null, CancellationToken cancellationToken = default(CancellationToken)); + bool? disableNotifications = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/Okta.Sdk/Generated/IGroupsClient.Generated.cs b/src/Okta.Sdk/Generated/IGroupsClient.Generated.cs index b697dded4..94957f35b 100644 --- a/src/Okta.Sdk/Generated/IGroupsClient.Generated.cs +++ b/src/Okta.Sdk/Generated/IGroupsClient.Generated.cs @@ -145,7 +145,7 @@ public partial interface IGroupsClient /// /// The cancellation token. /// The response. - Task AssignRoleToGroupAsync(IAssignRoleRequest assignRoleRequest, string groupId, string disableNotifications = null, CancellationToken cancellationToken = default(CancellationToken)); + Task AssignRoleToGroupAsync(IAssignRoleRequest assignRoleRequest, string groupId, bool? disableNotifications = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Unassigns a Role from a Group diff --git a/src/Okta.Sdk/Generated/IImageUploadResponse.Generated.cs b/src/Okta.Sdk/Generated/IImageUploadResponse.Generated.cs new file mode 100644 index 000000000..c37b6b11d --- /dev/null +++ b/src/Okta.Sdk/Generated/IImageUploadResponse.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 ImageUploadResponse resource in the Okta API. + public partial interface IImageUploadResponse : IResource + { + string Url { get; } + + } +} diff --git a/src/Okta.Sdk/Generated/IKnowledgeConstraint.Generated.cs b/src/Okta.Sdk/Generated/IKnowledgeConstraint.Generated.cs new file mode 100644 index 000000000..605583251 --- /dev/null +++ b/src/Okta.Sdk/Generated/IKnowledgeConstraint.Generated.cs @@ -0,0 +1,19 @@ +// +// 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 KnowledgeConstraint resource in the Okta API. + public partial interface IKnowledgeConstraint : IAccessPolicyConstraint + { + } +} diff --git a/src/Okta.Sdk/Generated/IOrgSetting.Generated.cs b/src/Okta.Sdk/Generated/IOrgSetting.Generated.cs index 301670ead..c49c8b518 100644 --- a/src/Okta.Sdk/Generated/IOrgSetting.Generated.cs +++ b/src/Okta.Sdk/Generated/IOrgSetting.Generated.cs @@ -49,5 +49,29 @@ public partial interface IOrgSetting : IResource string Website { get; set; } + Task PartialUpdateAsync(IOrgSetting orgSetting, + CancellationToken cancellationToken = default(CancellationToken)); + + ICollectionClient GetContactTypes( + ); + + Task GetOrgContactUserAsync( + string contactType, CancellationToken cancellationToken = default(CancellationToken)); + + Task GetSupportSettingsAsync( + CancellationToken cancellationToken = default(CancellationToken)); + + Task CommunicationSettingsAsync( + CancellationToken cancellationToken = default(CancellationToken)); + + Task OrgPreferencesAsync( + CancellationToken cancellationToken = default(CancellationToken)); + + Task ShowFooterAsync( + CancellationToken cancellationToken = default(CancellationToken)); + + Task HideFooterAsync( + CancellationToken cancellationToken = default(CancellationToken)); + } } diff --git a/src/Okta.Sdk/Generated/IPossessionConstraint.Generated.cs b/src/Okta.Sdk/Generated/IPossessionConstraint.Generated.cs new file mode 100644 index 000000000..d97fd367b --- /dev/null +++ b/src/Okta.Sdk/Generated/IPossessionConstraint.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 PossessionConstraint resource in the Okta API. + public partial interface IPossessionConstraint : IAccessPolicyConstraint + { + string DeviceBound { get; set; } + + string HardwareProtection { get; set; } + + string PhishingResistant { get; set; } + + string UserPresence { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IPreRegistrationInlineHook.Generated.cs b/src/Okta.Sdk/Generated/IPreRegistrationInlineHook.Generated.cs new file mode 100644 index 000000000..a483e924e --- /dev/null +++ b/src/Okta.Sdk/Generated/IPreRegistrationInlineHook.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 PreRegistrationInlineHook resource in the Okta API. + public partial interface IPreRegistrationInlineHook : IResource + { + string InlineHookId { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IProfileEnrollmentPolicy.Generated.cs b/src/Okta.Sdk/Generated/IProfileEnrollmentPolicy.Generated.cs new file mode 100644 index 000000000..d8e7c0aca --- /dev/null +++ b/src/Okta.Sdk/Generated/IProfileEnrollmentPolicy.Generated.cs @@ -0,0 +1,19 @@ +// +// 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 ProfileEnrollmentPolicy resource in the Okta API. + public partial interface IProfileEnrollmentPolicy : IPolicy + { + } +} diff --git a/src/Okta.Sdk/Generated/IProfileEnrollmentPolicyRule.Generated.cs b/src/Okta.Sdk/Generated/IProfileEnrollmentPolicyRule.Generated.cs new file mode 100644 index 000000000..a0e576140 --- /dev/null +++ b/src/Okta.Sdk/Generated/IProfileEnrollmentPolicyRule.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 ProfileEnrollmentPolicyRule resource in the Okta API. + public partial interface IProfileEnrollmentPolicyRule : IPolicyRule + { + IProfileEnrollmentPolicyRuleActions Actions { get; set; } + + string Name { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IProfileEnrollmentPolicyRuleAction.Generated.cs b/src/Okta.Sdk/Generated/IProfileEnrollmentPolicyRuleAction.Generated.cs new file mode 100644 index 000000000..e47a2522f --- /dev/null +++ b/src/Okta.Sdk/Generated/IProfileEnrollmentPolicyRuleAction.Generated.cs @@ -0,0 +1,31 @@ +// +// 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 ProfileEnrollmentPolicyRuleAction resource in the Okta API. + public partial interface IProfileEnrollmentPolicyRuleAction : IResource + { + string Access { get; set; } + + IProfileEnrollmentPolicyRuleActivationRequirement ActivationRequirements { get; set; } + + IList PreRegistrationInlineHooks { get; set; } + + IList ProfileAttributes { get; set; } + + IList TargetGroupIds { get; set; } + + string UnknownUserAction { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IProfileEnrollmentPolicyRuleActions.Generated.cs b/src/Okta.Sdk/Generated/IProfileEnrollmentPolicyRuleActions.Generated.cs new file mode 100644 index 000000000..a09d0f08e --- /dev/null +++ b/src/Okta.Sdk/Generated/IProfileEnrollmentPolicyRuleActions.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 ProfileEnrollmentPolicyRuleActions resource in the Okta API. + public partial interface IProfileEnrollmentPolicyRuleActions : IPolicyRuleActions + { + IProfileEnrollmentPolicyRuleAction ProfileEnrollment { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IProfileEnrollmentPolicyRuleActivationRequirement.Generated.cs b/src/Okta.Sdk/Generated/IProfileEnrollmentPolicyRuleActivationRequirement.Generated.cs new file mode 100644 index 000000000..73c13790a --- /dev/null +++ b/src/Okta.Sdk/Generated/IProfileEnrollmentPolicyRuleActivationRequirement.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 ProfileEnrollmentPolicyRuleActivationRequirement resource in the Okta API. + public partial interface IProfileEnrollmentPolicyRuleActivationRequirement : IResource + { + bool? EmailVerification { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IProfileEnrollmentPolicyRuleProfileAttribute.Generated.cs b/src/Okta.Sdk/Generated/IProfileEnrollmentPolicyRuleProfileAttribute.Generated.cs new file mode 100644 index 000000000..a0683b6ff --- /dev/null +++ b/src/Okta.Sdk/Generated/IProfileEnrollmentPolicyRuleProfileAttribute.Generated.cs @@ -0,0 +1,25 @@ +// +// 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 ProfileEnrollmentPolicyRuleProfileAttribute resource in the Okta API. + public partial interface IProfileEnrollmentPolicyRuleProfileAttribute : IResource + { + string Label { get; set; } + + string Name { get; set; } + + bool? Required { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/ISwaApplicationSettingsApplication.Generated.cs b/src/Okta.Sdk/Generated/ISwaApplicationSettingsApplication.Generated.cs index 346c23ed6..4b28c676c 100644 --- a/src/Okta.Sdk/Generated/ISwaApplicationSettingsApplication.Generated.cs +++ b/src/Okta.Sdk/Generated/ISwaApplicationSettingsApplication.Generated.cs @@ -17,10 +17,14 @@ public partial interface ISwaApplicationSettingsApplication : IApplicationSettin { string ButtonField { get; set; } + string Checkbox { get; set; } + string LoginUrlRegex { get; set; } string PasswordField { get; set; } + string RedirectUrl { get; set; } + string Url { get; set; } string UsernameField { get; set; } diff --git a/src/Okta.Sdk/Generated/ITheme.Generated.cs b/src/Okta.Sdk/Generated/ITheme.Generated.cs new file mode 100644 index 000000000..56b7974d1 --- /dev/null +++ b/src/Okta.Sdk/Generated/ITheme.Generated.cs @@ -0,0 +1,46 @@ +// +// 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 Theme resource in the Okta API. + public partial interface ITheme : IResource + { + string BackgroundImage { get; } + + EmailTemplateTouchPointVariant EmailTemplateTouchPointVariant { get; set; } + + EndUserDashboardTouchPointVariant EndUserDashboardTouchPointVariant { get; set; } + + ErrorPageTouchPointVariant ErrorPageTouchPointVariant { get; set; } + + string PrimaryColorContrastHex { get; set; } + + string PrimaryColorHex { get; set; } + + string SecondaryColorContrastHex { get; set; } + + string SecondaryColorHex { get; set; } + + SignInPageTouchPointVariant SignInPageTouchPointVariant { get; set; } + + Task DeleteBrandThemeLogoAsync( + string brandId, string themeId, CancellationToken cancellationToken = default(CancellationToken)); + + Task DeleteBrandThemeFaviconAsync( + string brandId, string themeId, CancellationToken cancellationToken = default(CancellationToken)); + + Task DeleteBrandThemeBackgroundImageAsync( + string brandId, string themeId, CancellationToken cancellationToken = default(CancellationToken)); + + } +} diff --git a/src/Okta.Sdk/Generated/IThemeResponse.Generated.cs b/src/Okta.Sdk/Generated/IThemeResponse.Generated.cs new file mode 100644 index 000000000..792fdb007 --- /dev/null +++ b/src/Okta.Sdk/Generated/IThemeResponse.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. + +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Okta.Sdk +{ + /// Represents a ThemeResponse resource in the Okta API. + public partial interface IThemeResponse : IResource + { + string BackgroundImage { get; } + + EmailTemplateTouchPointVariant EmailTemplateTouchPointVariant { get; set; } + + EndUserDashboardTouchPointVariant EndUserDashboardTouchPointVariant { get; set; } + + ErrorPageTouchPointVariant ErrorPageTouchPointVariant { get; set; } + + string Favicon { get; } + + string Id { get; } + + string Logo { get; } + + string PrimaryColorContrastHex { get; set; } + + string PrimaryColorHex { get; set; } + + string SecondaryColorContrastHex { get; set; } + + string SecondaryColorHex { get; set; } + + SignInPageTouchPointVariant SignInPageTouchPointVariant { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IUser.Generated.cs b/src/Okta.Sdk/Generated/IUser.Generated.cs index 1b89584d8..8342aa752 100644 --- a/src/Okta.Sdk/Generated/IUser.Generated.cs +++ b/src/Okta.Sdk/Generated/IUser.Generated.cs @@ -46,7 +46,10 @@ Task ForgotPasswordGenerateOneTimeTokenAsync( bool? sendEmail = true, CancellationToken cancellationToken = default(CancellationToken)); Task AssignRoleAsync(IAssignRoleRequest assignRoleRequest, - string disableNotifications = null, CancellationToken cancellationToken = default(CancellationToken)); + bool? disableNotifications = null, CancellationToken cancellationToken = default(CancellationToken)); + + Task GetRoleAsync( + string roleId, CancellationToken cancellationToken = default(CancellationToken)); Task RemoveRoleAsync( string roleId, CancellationToken cancellationToken = default(CancellationToken)); diff --git a/src/Okta.Sdk/Generated/IUserIdString.Generated.cs b/src/Okta.Sdk/Generated/IUserIdString.Generated.cs index 8edd5e621..8736b8d4c 100644 --- a/src/Okta.Sdk/Generated/IUserIdString.Generated.cs +++ b/src/Okta.Sdk/Generated/IUserIdString.Generated.cs @@ -13,7 +13,7 @@ namespace Okta.Sdk { /// Represents a UserIdString resource in the Okta API. - public partial interface IUserIdString : IResource + public partial interface IUserIdString : IOrgContactUser { string UserId { get; set; } diff --git a/src/Okta.Sdk/Generated/IUserTypeCondition.Generated.cs b/src/Okta.Sdk/Generated/IUserTypeCondition.Generated.cs new file mode 100644 index 000000000..f571d1219 --- /dev/null +++ b/src/Okta.Sdk/Generated/IUserTypeCondition.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 UserTypeCondition resource in the Okta API. + public partial interface IUserTypeCondition : IResource + { + IList Exclude { get; set; } + + IList Include { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/IUsersClient.Generated.cs b/src/Okta.Sdk/Generated/IUsersClient.Generated.cs index c01472a58..5c8e5f259 100644 --- a/src/Okta.Sdk/Generated/IUsersClient.Generated.cs +++ b/src/Okta.Sdk/Generated/IUsersClient.Generated.cs @@ -263,7 +263,7 @@ public partial interface IUsersClient 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. + /// Deactivates a user. This operation can only be performed on users that do not have a `DEPROVISIONED` status. While the asynchronous operation (triggered by HTTP header `Prefer: respond-async`) is proceeding the user's `transitioningToStatus` property is `DEPROVISIONED`. The user's status is `DEPROVISIONED` when the deactivation process is complete. /// /// /// @@ -372,7 +372,7 @@ public partial interface IUsersClient /// /// The cancellation token. /// The response. - Task AssignRoleToUserAsync(IAssignRoleRequest assignRoleRequest, string userId, string disableNotifications = null, CancellationToken cancellationToken = default(CancellationToken)); + Task AssignRoleToUserAsync(IAssignRoleRequest assignRoleRequest, string userId, bool? disableNotifications = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Unassigns a role from a user. diff --git a/src/Okta.Sdk/Generated/IVerificationMethod.Generated.cs b/src/Okta.Sdk/Generated/IVerificationMethod.Generated.cs new file mode 100644 index 000000000..0e36157b4 --- /dev/null +++ b/src/Okta.Sdk/Generated/IVerificationMethod.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 VerificationMethod resource in the Okta API. + public partial interface IVerificationMethod : IResource + { + IList Constraints { get; set; } + + string FactorMode { get; set; } + + string ReauthenticateIn { get; set; } + + string Type { get; set; } + + } +} diff --git a/src/Okta.Sdk/Generated/ImageUploadResponse.Generated.cs b/src/Okta.Sdk/Generated/ImageUploadResponse.Generated.cs new file mode 100644 index 000000000..02ab61cf1 --- /dev/null +++ b/src/Okta.Sdk/Generated/ImageUploadResponse.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; +using Okta.Sdk.Internal; + +namespace Okta.Sdk +{ + /// + public sealed partial class ImageUploadResponse : Resource, IImageUploadResponse + { + /// + public string Url => GetStringProperty("url"); + + } +} diff --git a/src/Okta.Sdk/Generated/KnowledgeConstraint.Generated.cs b/src/Okta.Sdk/Generated/KnowledgeConstraint.Generated.cs new file mode 100644 index 000000000..6aaaae0a9 --- /dev/null +++ b/src/Okta.Sdk/Generated/KnowledgeConstraint.Generated.cs @@ -0,0 +1,20 @@ +// +// 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 KnowledgeConstraint : AccessPolicyConstraint, IKnowledgeConstraint + { + } +} diff --git a/src/Okta.Sdk/Generated/OrgContactUser.Generated.cs b/src/Okta.Sdk/Generated/OrgContactUser.Generated.cs index 2f6dde329..a99394dbb 100644 --- a/src/Okta.Sdk/Generated/OrgContactUser.Generated.cs +++ b/src/Okta.Sdk/Generated/OrgContactUser.Generated.cs @@ -14,7 +14,7 @@ namespace Okta.Sdk { /// - public sealed partial class OrgContactUser : Resource, IOrgContactUser + public partial class OrgContactUser : Resource, IOrgContactUser { /// public string UserId diff --git a/src/Okta.Sdk/Generated/OrgSetting.Generated.cs b/src/Okta.Sdk/Generated/OrgSetting.Generated.cs index 2faedab79..69c126ac0 100644 --- a/src/Okta.Sdk/Generated/OrgSetting.Generated.cs +++ b/src/Okta.Sdk/Generated/OrgSetting.Generated.cs @@ -111,5 +111,45 @@ public string Website set => this["website"] = value; } + /// + public Task PartialUpdateAsync(IOrgSetting orgSetting, + CancellationToken cancellationToken = default(CancellationToken)) + => GetClient().Orgs.PartialUpdateOrgSettingAsync(orgSetting, cancellationToken); + + /// + public ICollectionClient GetContactTypes( + ) + => GetClient().Orgs.GetOrgContactTypes(); + + /// + public Task GetOrgContactUserAsync( + string contactType, CancellationToken cancellationToken = default(CancellationToken)) + => GetClient().Orgs.GetOrgContactUserAsync(contactType, cancellationToken); + + /// + public Task GetSupportSettingsAsync( + CancellationToken cancellationToken = default(CancellationToken)) + => GetClient().Orgs.GetOrgOktaSupportSettingsAsync(cancellationToken); + + /// + public Task CommunicationSettingsAsync( + CancellationToken cancellationToken = default(CancellationToken)) + => GetClient().Orgs.GetOktaCommunicationSettingsAsync(cancellationToken); + + /// + public Task OrgPreferencesAsync( + CancellationToken cancellationToken = default(CancellationToken)) + => GetClient().Orgs.GetOrgPreferencesAsync(cancellationToken); + + /// + public Task ShowFooterAsync( + CancellationToken cancellationToken = default(CancellationToken)) + => GetClient().Orgs.ShowOktaUiFooterAsync(cancellationToken); + + /// + public Task HideFooterAsync( + CancellationToken cancellationToken = default(CancellationToken)) + => GetClient().Orgs.HideOktaUiFooterAsync(cancellationToken); + } } diff --git a/src/Okta.Sdk/Generated/PolicyResolver.Generated.cs b/src/Okta.Sdk/Generated/PolicyResolver.Generated.cs index 9c5a7d77e..f889f8c6b 100644 --- a/src/Okta.Sdk/Generated/PolicyResolver.Generated.cs +++ b/src/Okta.Sdk/Generated/PolicyResolver.Generated.cs @@ -30,6 +30,11 @@ protected override Type GetResolvedTypeInternal(IDictionary data return typeof(Policy); } + if (value.Equals("ACCESS_POLICY")) + { + return typeof(AccessPolicy); + } + if (value.Equals("IDP_DISCOVERY")) { return typeof(IdentityProviderPolicy); @@ -50,6 +55,11 @@ protected override Type GetResolvedTypeInternal(IDictionary data return typeof(PasswordPolicy); } + if (value.Equals("PROFILE_ENROLLMENT")) + { + return typeof(ProfileEnrollmentPolicy); + } + return typeof(Policy); } } diff --git a/src/Okta.Sdk/Generated/PolicyRuleResolver.Generated.cs b/src/Okta.Sdk/Generated/PolicyRuleResolver.Generated.cs index e1bab2b4f..60fa35e51 100644 --- a/src/Okta.Sdk/Generated/PolicyRuleResolver.Generated.cs +++ b/src/Okta.Sdk/Generated/PolicyRuleResolver.Generated.cs @@ -30,11 +30,21 @@ protected override Type GetResolvedTypeInternal(IDictionary data return typeof(PolicyRule); } + if (value.Equals("ACCESS_POLICY")) + { + return typeof(AccessPolicyRule); + } + if (value.Equals("PASSWORD")) { return typeof(PasswordPolicyRule); } + if (value.Equals("PROFILE_ENROLLMENT")) + { + return typeof(ProfileEnrollmentPolicyRule); + } + if (value.Equals("SIGN_ON")) { return typeof(OktaSignOnPolicyRule); diff --git a/src/Okta.Sdk/Generated/PolicyType.Generated.cs b/src/Okta.Sdk/Generated/PolicyType.Generated.cs index fadde6f50..16538aa53 100644 --- a/src/Okta.Sdk/Generated/PolicyType.Generated.cs +++ b/src/Okta.Sdk/Generated/PolicyType.Generated.cs @@ -24,6 +24,12 @@ public sealed class PolicyType : StringEnum /// The IDP_DISCOVERY PolicyType. public static PolicyType IdpDiscovery = new PolicyType("IDP_DISCOVERY"); + /// The PROFILE_ENROLLMENT PolicyType. + public static PolicyType ProfileEnrollment = new PolicyType("PROFILE_ENROLLMENT"); + + /// The ACCESS_POLICY PolicyType. + public static PolicyType AccessPolicy = new PolicyType("ACCESS_POLICY"); + /// /// Implicit operator declaration to accept and convert a string value as a /// diff --git a/src/Okta.Sdk/Generated/PossessionConstraint.Generated.cs b/src/Okta.Sdk/Generated/PossessionConstraint.Generated.cs new file mode 100644 index 000000000..c78714b7e --- /dev/null +++ b/src/Okta.Sdk/Generated/PossessionConstraint.Generated.cs @@ -0,0 +1,48 @@ +// +// 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 PossessionConstraint : AccessPolicyConstraint, IPossessionConstraint + { + /// + public string DeviceBound + { + get => GetStringProperty("deviceBound"); + set => this["deviceBound"] = value; + } + + /// + public string HardwareProtection + { + get => GetStringProperty("hardwareProtection"); + set => this["hardwareProtection"] = value; + } + + /// + public string PhishingResistant + { + get => GetStringProperty("phishingResistant"); + set => this["phishingResistant"] = value; + } + + /// + public string UserPresence + { + get => GetStringProperty("userPresence"); + set => this["userPresence"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/PreRegistrationInlineHook.Generated.cs b/src/Okta.Sdk/Generated/PreRegistrationInlineHook.Generated.cs new file mode 100644 index 000000000..b285d96bc --- /dev/null +++ b/src/Okta.Sdk/Generated/PreRegistrationInlineHook.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 PreRegistrationInlineHook : Resource, IPreRegistrationInlineHook + { + /// + public string InlineHookId + { + get => GetStringProperty("inlineHookId"); + set => this["inlineHookId"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/ProfileEnrollmentPolicy.Generated.cs b/src/Okta.Sdk/Generated/ProfileEnrollmentPolicy.Generated.cs new file mode 100644 index 000000000..5f4376385 --- /dev/null +++ b/src/Okta.Sdk/Generated/ProfileEnrollmentPolicy.Generated.cs @@ -0,0 +1,20 @@ +// +// 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 ProfileEnrollmentPolicy : Policy, IProfileEnrollmentPolicy + { + } +} diff --git a/src/Okta.Sdk/Generated/ProfileEnrollmentPolicyRule.Generated.cs b/src/Okta.Sdk/Generated/ProfileEnrollmentPolicyRule.Generated.cs new file mode 100644 index 000000000..6a2b4ef09 --- /dev/null +++ b/src/Okta.Sdk/Generated/ProfileEnrollmentPolicyRule.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 ProfileEnrollmentPolicyRule : PolicyRule, IProfileEnrollmentPolicyRule + { + /// + public IProfileEnrollmentPolicyRuleActions Actions + { + get => GetResourceProperty("actions"); + set => this["actions"] = value; + } + + /// + public string Name + { + get => GetStringProperty("name"); + set => this["name"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/ProfileEnrollmentPolicyRuleAction.Generated.cs b/src/Okta.Sdk/Generated/ProfileEnrollmentPolicyRuleAction.Generated.cs new file mode 100644 index 000000000..88ca38221 --- /dev/null +++ b/src/Okta.Sdk/Generated/ProfileEnrollmentPolicyRuleAction.Generated.cs @@ -0,0 +1,62 @@ +// +// 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 ProfileEnrollmentPolicyRuleAction : Resource, IProfileEnrollmentPolicyRuleAction + { + /// + public string Access + { + get => GetStringProperty("access"); + set => this["access"] = value; + } + + /// + public IProfileEnrollmentPolicyRuleActivationRequirement ActivationRequirements + { + get => GetResourceProperty("activationRequirements"); + set => this["activationRequirements"] = value; + } + + /// + public IList PreRegistrationInlineHooks + { + get => GetArrayProperty("preRegistrationInlineHooks"); + set => this["preRegistrationInlineHooks"] = value; + } + + /// + public IList ProfileAttributes + { + get => GetArrayProperty("profileAttributes"); + set => this["profileAttributes"] = value; + } + + /// + public IList TargetGroupIds + { + get => GetArrayProperty("targetGroupIds"); + set => this["targetGroupIds"] = value; + } + + /// + public string UnknownUserAction + { + get => GetStringProperty("unknownUserAction"); + set => this["unknownUserAction"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/ProfileEnrollmentPolicyRuleActions.Generated.cs b/src/Okta.Sdk/Generated/ProfileEnrollmentPolicyRuleActions.Generated.cs new file mode 100644 index 000000000..f6ee1525e --- /dev/null +++ b/src/Okta.Sdk/Generated/ProfileEnrollmentPolicyRuleActions.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 ProfileEnrollmentPolicyRuleActions : PolicyRuleActions, IProfileEnrollmentPolicyRuleActions + { + /// + public IProfileEnrollmentPolicyRuleAction ProfileEnrollment + { + get => GetResourceProperty("profileEnrollment"); + set => this["profileEnrollment"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/ProfileEnrollmentPolicyRuleActivationRequirement.Generated.cs b/src/Okta.Sdk/Generated/ProfileEnrollmentPolicyRuleActivationRequirement.Generated.cs new file mode 100644 index 000000000..0109c3eaf --- /dev/null +++ b/src/Okta.Sdk/Generated/ProfileEnrollmentPolicyRuleActivationRequirement.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 ProfileEnrollmentPolicyRuleActivationRequirement : Resource, IProfileEnrollmentPolicyRuleActivationRequirement + { + /// + public bool? EmailVerification + { + get => GetBooleanProperty("emailVerification"); + set => this["emailVerification"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/ProfileEnrollmentPolicyRuleProfileAttribute.Generated.cs b/src/Okta.Sdk/Generated/ProfileEnrollmentPolicyRuleProfileAttribute.Generated.cs new file mode 100644 index 000000000..48f3f8640 --- /dev/null +++ b/src/Okta.Sdk/Generated/ProfileEnrollmentPolicyRuleProfileAttribute.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 ProfileEnrollmentPolicyRuleProfileAttribute : Resource, IProfileEnrollmentPolicyRuleProfileAttribute + { + /// + public string Label + { + get => GetStringProperty("label"); + set => this["label"] = value; + } + + /// + public string Name + { + get => GetStringProperty("name"); + set => this["name"] = value; + } + + /// + public bool? Required + { + get => GetBooleanProperty("required"); + set => this["required"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/RequiredEnum.Generated.cs b/src/Okta.Sdk/Generated/RequiredEnum.Generated.cs new file mode 100644 index 000000000..4ac168ac9 --- /dev/null +++ b/src/Okta.Sdk/Generated/RequiredEnum.Generated.cs @@ -0,0 +1,40 @@ +// +// 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 RequiredEnum values in the Okta API. + /// + public sealed class RequiredEnum : StringEnum + { + /// The ALWAYS RequiredEnum. + public static RequiredEnum Always = new RequiredEnum("ALWAYS"); + + /// The HIGH_RISK_ONLY RequiredEnum. + public static RequiredEnum HighRiskOnly = new RequiredEnum("HIGH_RISK_ONLY"); + + /// The NEVER RequiredEnum. + public static RequiredEnum Never = new RequiredEnum("NEVER"); + + /// + /// Implicit operator declaration to accept and convert a string value as a + /// + /// The value to use + public static implicit operator RequiredEnum(string value) => new RequiredEnum(value); + + /// + /// Creates a new instance. + /// + /// The value to use. + public RequiredEnum(string value) + : base(value) + { + } + + } +} diff --git a/src/Okta.Sdk/Generated/SignInPageTouchPointVariant.Generated.cs b/src/Okta.Sdk/Generated/SignInPageTouchPointVariant.Generated.cs new file mode 100644 index 000000000..99d0bf7a3 --- /dev/null +++ b/src/Okta.Sdk/Generated/SignInPageTouchPointVariant.Generated.cs @@ -0,0 +1,40 @@ +// +// 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 SignInPageTouchPointVariant values in the Okta API. + /// + public sealed class SignInPageTouchPointVariant : StringEnum + { + /// The OKTA_DEFAULT SignInPageTouchPointVariant. + public static SignInPageTouchPointVariant OktaDefault = new SignInPageTouchPointVariant("OKTA_DEFAULT"); + + /// The BACKGROUND_SECONDARY_COLOR SignInPageTouchPointVariant. + public static SignInPageTouchPointVariant BackgroundSecondaryColor = new SignInPageTouchPointVariant("BACKGROUND_SECONDARY_COLOR"); + + /// The BACKGROUND_IMAGE SignInPageTouchPointVariant. + public static SignInPageTouchPointVariant BackgroundImage = new SignInPageTouchPointVariant("BACKGROUND_IMAGE"); + + /// + /// Implicit operator declaration to accept and convert a string value as a + /// + /// The value to use + public static implicit operator SignInPageTouchPointVariant(string value) => new SignInPageTouchPointVariant(value); + + /// + /// Creates a new instance. + /// + /// The value to use. + public SignInPageTouchPointVariant(string value) + : base(value) + { + } + + } +} diff --git a/src/Okta.Sdk/Generated/SwaApplicationSettingsApplication.Generated.cs b/src/Okta.Sdk/Generated/SwaApplicationSettingsApplication.Generated.cs index 8dbd5b6c4..b526b1532 100644 --- a/src/Okta.Sdk/Generated/SwaApplicationSettingsApplication.Generated.cs +++ b/src/Okta.Sdk/Generated/SwaApplicationSettingsApplication.Generated.cs @@ -23,6 +23,13 @@ public string ButtonField set => this["buttonField"] = value; } + /// + public string Checkbox + { + get => GetStringProperty("checkbox"); + set => this["checkbox"] = value; + } + /// public string LoginUrlRegex { @@ -37,6 +44,13 @@ public string PasswordField set => this["passwordField"] = value; } + /// + public string RedirectUrl + { + get => GetStringProperty("redirectUrl"); + set => this["redirectUrl"] = value; + } + /// public string Url { diff --git a/src/Okta.Sdk/Generated/Theme.Generated.cs b/src/Okta.Sdk/Generated/Theme.Generated.cs new file mode 100644 index 000000000..adc15cc0a --- /dev/null +++ b/src/Okta.Sdk/Generated/Theme.Generated.cs @@ -0,0 +1,94 @@ +// +// 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 Theme : Resource, ITheme + { + /// + public string BackgroundImage => GetStringProperty("backgroundImage"); + + /// + public EmailTemplateTouchPointVariant EmailTemplateTouchPointVariant + { + get => GetEnumProperty("emailTemplateTouchPointVariant"); + set => this["emailTemplateTouchPointVariant"] = value; + } + + /// + public EndUserDashboardTouchPointVariant EndUserDashboardTouchPointVariant + { + get => GetEnumProperty("endUserDashboardTouchPointVariant"); + set => this["endUserDashboardTouchPointVariant"] = value; + } + + /// + public ErrorPageTouchPointVariant ErrorPageTouchPointVariant + { + get => GetEnumProperty("errorPageTouchPointVariant"); + set => this["errorPageTouchPointVariant"] = value; + } + + /// + public string PrimaryColorContrastHex + { + get => GetStringProperty("primaryColorContrastHex"); + set => this["primaryColorContrastHex"] = value; + } + + /// + public string PrimaryColorHex + { + get => GetStringProperty("primaryColorHex"); + set => this["primaryColorHex"] = value; + } + + /// + public string SecondaryColorContrastHex + { + get => GetStringProperty("secondaryColorContrastHex"); + set => this["secondaryColorContrastHex"] = value; + } + + /// + public string SecondaryColorHex + { + get => GetStringProperty("secondaryColorHex"); + set => this["secondaryColorHex"] = value; + } + + /// + public SignInPageTouchPointVariant SignInPageTouchPointVariant + { + get => GetEnumProperty("signInPageTouchPointVariant"); + set => this["signInPageTouchPointVariant"] = value; + } + + /// + public Task DeleteBrandThemeLogoAsync( + string brandId, string themeId, CancellationToken cancellationToken = default(CancellationToken)) + => GetClient().Brands.DeleteBrandThemeLogoAsync(brandId, themeId, cancellationToken); + + /// + public Task DeleteBrandThemeFaviconAsync( + string brandId, string themeId, CancellationToken cancellationToken = default(CancellationToken)) + => GetClient().Brands.DeleteBrandThemeFaviconAsync(brandId, themeId, cancellationToken); + + /// + public Task DeleteBrandThemeBackgroundImageAsync( + string brandId, string themeId, CancellationToken cancellationToken = default(CancellationToken)) + => GetClient().Brands.DeleteBrandThemeBackgroundImageAsync(brandId, themeId, cancellationToken); + + } +} diff --git a/src/Okta.Sdk/Generated/ThemeResponse.Generated.cs b/src/Okta.Sdk/Generated/ThemeResponse.Generated.cs new file mode 100644 index 000000000..cbc5514fc --- /dev/null +++ b/src/Okta.Sdk/Generated/ThemeResponse.Generated.cs @@ -0,0 +1,88 @@ +// +// 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 ThemeResponse : Resource, IThemeResponse + { + /// + public string BackgroundImage => GetStringProperty("backgroundImage"); + + /// + public EmailTemplateTouchPointVariant EmailTemplateTouchPointVariant + { + get => GetEnumProperty("emailTemplateTouchPointVariant"); + set => this["emailTemplateTouchPointVariant"] = value; + } + + /// + public EndUserDashboardTouchPointVariant EndUserDashboardTouchPointVariant + { + get => GetEnumProperty("endUserDashboardTouchPointVariant"); + set => this["endUserDashboardTouchPointVariant"] = value; + } + + /// + public ErrorPageTouchPointVariant ErrorPageTouchPointVariant + { + get => GetEnumProperty("errorPageTouchPointVariant"); + set => this["errorPageTouchPointVariant"] = value; + } + + /// + public string Favicon => GetStringProperty("favicon"); + + /// + public string Id => GetStringProperty("id"); + + /// + public string Logo => GetStringProperty("logo"); + + /// + public string PrimaryColorContrastHex + { + get => GetStringProperty("primaryColorContrastHex"); + set => this["primaryColorContrastHex"] = value; + } + + /// + public string PrimaryColorHex + { + get => GetStringProperty("primaryColorHex"); + set => this["primaryColorHex"] = value; + } + + /// + public string SecondaryColorContrastHex + { + get => GetStringProperty("secondaryColorContrastHex"); + set => this["secondaryColorContrastHex"] = value; + } + + /// + public string SecondaryColorHex + { + get => GetStringProperty("secondaryColorHex"); + set => this["secondaryColorHex"] = value; + } + + /// + public SignInPageTouchPointVariant SignInPageTouchPointVariant + { + get => GetEnumProperty("signInPageTouchPointVariant"); + set => this["signInPageTouchPointVariant"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/User.Generated.cs b/src/Okta.Sdk/Generated/User.Generated.cs index d6d88e643..a4b993c4e 100644 --- a/src/Okta.Sdk/Generated/User.Generated.cs +++ b/src/Okta.Sdk/Generated/User.Generated.cs @@ -76,9 +76,14 @@ public Task ForgotPasswordGenerateOneTimeTokenAsync( /// public Task AssignRoleAsync(IAssignRoleRequest assignRoleRequest, - string disableNotifications = null, CancellationToken cancellationToken = default(CancellationToken)) + bool? disableNotifications = null, CancellationToken cancellationToken = default(CancellationToken)) => GetClient().Users.AssignRoleToUserAsync(assignRoleRequest, Id, disableNotifications, cancellationToken); + /// + public Task GetRoleAsync( + string roleId, CancellationToken cancellationToken = default(CancellationToken)) + => GetClient().Users.GetUserRoleAsync(Id, roleId, cancellationToken); + /// public Task RemoveRoleAsync( string roleId, CancellationToken cancellationToken = default(CancellationToken)) diff --git a/src/Okta.Sdk/Generated/UserIdString.Generated.cs b/src/Okta.Sdk/Generated/UserIdString.Generated.cs index 16ea77d8f..c994e0eb6 100644 --- a/src/Okta.Sdk/Generated/UserIdString.Generated.cs +++ b/src/Okta.Sdk/Generated/UserIdString.Generated.cs @@ -14,7 +14,7 @@ namespace Okta.Sdk { /// - public sealed partial class UserIdString : Resource, IUserIdString + public sealed partial class UserIdString : OrgContactUser, IUserIdString { /// public string UserId diff --git a/src/Okta.Sdk/Generated/UserTypeCondition.Generated.cs b/src/Okta.Sdk/Generated/UserTypeCondition.Generated.cs new file mode 100644 index 000000000..5bc0612da --- /dev/null +++ b/src/Okta.Sdk/Generated/UserTypeCondition.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 UserTypeCondition : Resource, IUserTypeCondition + { + /// + public IList Exclude + { + get => GetArrayProperty("exclude"); + set => this["exclude"] = value; + } + + /// + public IList Include + { + get => GetArrayProperty("include"); + set => this["include"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Generated/UserVerificationEnum.Generated.cs b/src/Okta.Sdk/Generated/UserVerificationEnum.Generated.cs new file mode 100644 index 000000000..b375a086e --- /dev/null +++ b/src/Okta.Sdk/Generated/UserVerificationEnum.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 UserVerificationEnum values in the Okta API. + /// + public sealed class UserVerificationEnum : StringEnum + { + /// The REQUIRED UserVerificationEnum. + public static UserVerificationEnum Required = new UserVerificationEnum("REQUIRED"); + + /// The PREFERRED UserVerificationEnum. + public static UserVerificationEnum Preferred = new UserVerificationEnum("PREFERRED"); + + /// + /// Implicit operator declaration to accept and convert a string value as a + /// + /// The value to use + public static implicit operator UserVerificationEnum(string value) => new UserVerificationEnum(value); + + /// + /// Creates a new instance. + /// + /// The value to use. + public UserVerificationEnum(string value) + : base(value) + { + } + + } +} diff --git a/src/Okta.Sdk/Generated/UsersClient.Generated.cs b/src/Okta.Sdk/Generated/UsersClient.Generated.cs index ac94b4b7b..373386b63 100644 --- a/src/Okta.Sdk/Generated/UsersClient.Generated.cs +++ b/src/Okta.Sdk/Generated/UsersClient.Generated.cs @@ -623,7 +623,7 @@ public ICollectionClient ListAssignedRolesForUser(string userId, string e }); /// - public async Task AssignRoleToUserAsync(IAssignRoleRequest assignRoleRequest, string userId, string disableNotifications = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task AssignRoleToUserAsync(IAssignRoleRequest assignRoleRequest, string userId, bool? disableNotifications = null, CancellationToken cancellationToken = default(CancellationToken)) => await PostAsync(new HttpRequest { Uri = "/api/v1/users/{userId}/roles", diff --git a/src/Okta.Sdk/Generated/VerificationMethod.Generated.cs b/src/Okta.Sdk/Generated/VerificationMethod.Generated.cs new file mode 100644 index 000000000..36d2c083e --- /dev/null +++ b/src/Okta.Sdk/Generated/VerificationMethod.Generated.cs @@ -0,0 +1,48 @@ +// +// 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 VerificationMethod : Resource, IVerificationMethod + { + /// + public IList Constraints + { + get => GetArrayProperty("constraints"); + set => this["constraints"] = value; + } + + /// + public string FactorMode + { + get => GetStringProperty("factorMode"); + set => this["factorMode"] = value; + } + + /// + public string ReauthenticateIn + { + get => GetStringProperty("reauthenticateIn"); + set => this["reauthenticateIn"] = value; + } + + /// + public string Type + { + get => GetStringProperty("type"); + set => this["type"] = value; + } + + } +} diff --git a/src/Okta.Sdk/Group.cs b/src/Okta.Sdk/Group.cs index 0a3ab94c2..23b5fcb5d 100644 --- a/src/Okta.Sdk/Group.cs +++ b/src/Okta.Sdk/Group.cs @@ -23,5 +23,9 @@ public IAsyncEnumerable Users /// public Task UpdateAsync(CancellationToken cancellationToken = default(CancellationToken)) => GetClient().Groups.UpdateGroupAsync(this, Id, cancellationToken); + + /// + public Task AssignRoleAsync(IAssignRoleRequest assignRoleRequest, string disableNotifications, CancellationToken cancellationToken = default(CancellationToken)) + => GetClient().Groups.AssignRoleToGroupAsync(assignRoleRequest, Id, (bool?)null, cancellationToken); } } diff --git a/src/Okta.Sdk/HttpRequest.cs b/src/Okta.Sdk/HttpRequest.cs index 14674c566..abfa7a255 100644 --- a/src/Okta.Sdk/HttpRequest.cs +++ b/src/Okta.Sdk/HttpRequest.cs @@ -70,7 +70,7 @@ public string ContentType } /// - /// Gets or sets the content encoding. + /// Gets or sets the content encoding. /// public string ContentTransferEncoding { diff --git a/src/Okta.Sdk/IApplication.cs b/src/Okta.Sdk/IApplication.cs new file mode 100644 index 000000000..fccd790a3 --- /dev/null +++ b/src/Okta.Sdk/IApplication.cs @@ -0,0 +1,18 @@ +// +// 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; + +namespace Okta.Sdk +{ + public partial interface IApplication + { + /// + /// Gets the access policy ID or null if it's not applicable. + /// + /// The access policy ID + string GetAccessPolicyId(); + } +} diff --git a/src/Okta.Sdk/IApplicationsClient.cs b/src/Okta.Sdk/IApplicationsClient.cs index 5b0c40bc8..9b65e217c 100644 --- a/src/Okta.Sdk/IApplicationsClient.cs +++ b/src/Okta.Sdk/IApplicationsClient.cs @@ -91,7 +91,7 @@ public partial interface IApplicationsClient : IAsyncEnumerable Task CreateApplicationAsync(CreateSamlApplicationOptions samlApplicationOptions, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Adds a WS-Federation Passive Requestor Profile application with a SAML 2.0 token. + /// Adds a WS-Federation Passive Request to Profile application with a SAML 2.0 token. /// /// The application settings helper /// The cancellation token @@ -145,8 +145,8 @@ public partial interface IApplicationsClient : IAsyncEnumerable /// Publishes with an X.509 certificate in base64 encoded CER. /// /// The resource. - /// - /// + /// The application Id. + /// The CSR Id. /// The cancellation token. /// The response. Task PublishCerCertAsync(string base64EncodedCertificateData, string appId, string csrId, CancellationToken cancellationToken = default(CancellationToken)); @@ -155,8 +155,8 @@ public partial interface IApplicationsClient : IAsyncEnumerable /// Publishes with an X.509 certificate in binary CER. /// /// The resource. - /// - /// + /// The application Id. + /// The CSR Id. /// The cancellation token. /// The response. Task PublishBinaryCerCertAsync(byte[] certificate, string appId, string csrId, CancellationToken cancellationToken = default(CancellationToken)); @@ -165,8 +165,8 @@ public partial interface IApplicationsClient : IAsyncEnumerable /// Publishes with an X.509 certificate in base64 encoded DER. /// /// The resource. - /// - /// + /// The application Id. + /// The CSR Id. /// The cancellation token. /// The response. Task PublishDerCertAsync(string base64EncodedCertificateData, string appId, string csrId, CancellationToken cancellationToken = default(CancellationToken)); @@ -175,8 +175,8 @@ public partial interface IApplicationsClient : IAsyncEnumerable /// Publishes with an X.509 certificate a binary DER. /// /// The resource. - /// - /// + /// The application Id. + /// The CSR Id. /// The cancellation token. /// The response. Task PublishBinaryDerCertAsync(byte[] certificate, string appId, string csrId, CancellationToken cancellationToken = default(CancellationToken)); @@ -185,8 +185,8 @@ public partial interface IApplicationsClient : IAsyncEnumerable /// Publishes with an X.509 certificate in PEM format. /// /// The resource. - /// - /// + /// The application Id. + /// The CSR Id. /// The cancellation token. /// The response. Task PublishBinaryPemCertAsync(byte[] certificate, string appId, string csrId, CancellationToken cancellationToken = default(CancellationToken)); diff --git a/src/Okta.Sdk/IBrandsClient.cs b/src/Okta.Sdk/IBrandsClient.cs new file mode 100644 index 000000000..4eac936ca --- /dev/null +++ b/src/Okta.Sdk/IBrandsClient.cs @@ -0,0 +1,45 @@ +// +// 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.IO; +using System.Threading; +using System.Threading.Tasks; + +namespace Okta.Sdk +{ + /// + public partial interface IBrandsClient + { + /// + /// Updates the logo for your Theme + /// + /// The file. + /// The brand Id. + /// The theme Id. + /// The cancellation token. + /// A + Task UploadBrandThemeLogoAsync(FileStream file, string brandId, string themeId, CancellationToken cancellationToken = default); + + /// + /// Updates the favicon for your Theme + /// + /// The file. + /// The brand Id. + /// The theme Id. + /// The cancellation token. + /// A + Task UploadBrandThemeFaviconAsync(FileStream file, string brandId, string themeId, CancellationToken cancellationToken = default); + + /// + /// Updates the background image for your Theme + /// + /// The file. + /// The brand Id. + /// The theme Id. + /// The cancellation token. + /// A + Task UploadBrandThemeBackgroundImageAsync(FileStream file, string brandId, string themeId, CancellationToken cancellationToken = default); + } +} diff --git a/src/Okta.Sdk/IGroup.cs b/src/Okta.Sdk/IGroup.cs index c0dbe1354..4e910c8c9 100644 --- a/src/Okta.Sdk/IGroup.cs +++ b/src/Okta.Sdk/IGroup.cs @@ -3,6 +3,7 @@ // 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.Threading; using System.Threading.Tasks; @@ -32,5 +33,15 @@ public partial interface IGroup /// The cancellation token. /// The updated Group. Task UpdateAsync(CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Assigns a role to a group. + /// + /// The request. + /// The flag to disable notifications. + /// The cancellation token. + /// The role. + [Obsolete("This method is deprecated and will be removed in the next major release. Use AssignRoleAsync but passing a bool? param for disableNotifications instead.")] + Task AssignRoleAsync(IAssignRoleRequest assignRoleRequest, string disableNotifications, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/Okta.Sdk/IOktaClient.cs b/src/Okta.Sdk/IOktaClient.cs index 7e71f370b..67112820c 100644 --- a/src/Okta.Sdk/IOktaClient.cs +++ b/src/Okta.Sdk/IOktaClient.cs @@ -23,6 +23,11 @@ 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. + /// + IBrandsClient Brands { get; } + /// /// Gets a GroupSchemasClient that interacts with the schemas API. /// @@ -205,6 +210,7 @@ public interface IOktaClient /// A ThreatInsightsClient that interacts with the Okta ThreatInsight configuration API. /// IThreatInsightsClient ThreatInsights { get; } + /// /// Creates a new OktaClient scoped to the given request context. /// diff --git a/src/Okta.Sdk/IOrgSetting.cs b/src/Okta.Sdk/IOrgSetting.cs new file mode 100644 index 000000000..b9785a91a --- /dev/null +++ b/src/Okta.Sdk/IOrgSetting.cs @@ -0,0 +1,23 @@ +// +// 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.IO; +using System.Threading; +using System.Threading.Tasks; + +namespace Okta.Sdk +{ + /// + public partial interface IOrgSetting + { + /// + /// Updates an org logo. + /// + /// The file + /// The cancellation token. + /// A task. + Task UpdateOrgLogoAsync(FileStream file, CancellationToken cancellationToken = default); + } +} diff --git a/src/Okta.Sdk/IOrgsClient.cs b/src/Okta.Sdk/IOrgsClient.cs new file mode 100644 index 000000000..728a480c9 --- /dev/null +++ b/src/Okta.Sdk/IOrgsClient.cs @@ -0,0 +1,23 @@ +// +// 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.IO; +using System.Threading; +using System.Threading.Tasks; + +namespace Okta.Sdk +{ + /// + public partial interface IOrgsClient + { + /// + /// Updates an org logo. + /// + /// The file + /// The cancellation token. + /// A task. + Task UpdateOrgLogoAsync(FileStream file, CancellationToken cancellationToken = default); + } +} diff --git a/src/Okta.Sdk/ITheme.cs b/src/Okta.Sdk/ITheme.cs new file mode 100644 index 000000000..6763eb56e --- /dev/null +++ b/src/Okta.Sdk/ITheme.cs @@ -0,0 +1,45 @@ +// +// 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.IO; +using System.Threading; +using System.Threading.Tasks; + +namespace Okta.Sdk +{ + /// + public partial interface ITheme + { + /// + /// Updates the logo for your Theme + /// + /// The file. + /// The brand Id. + /// The theme Id. + /// The cancellation token. + /// A + Task UploadBrandThemeLogoAsync(FileStream file, string brandId, string themeId, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Updates the Favicon for your Theme + /// + /// The file. + /// The brand Id. + /// The theme Id. + /// The cancellation token. + /// A + Task UpdateBrandThemeFaviconAsync(FileStream file, string brandId, string themeId, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Updates the background image for your Theme + /// + /// The file. + /// The brand Id. + /// The theme Id. + /// The cancellation token. + /// A + Task UpdateBrandThemeBackgroundImageAsync(FileStream file, string brandId, string themeId, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/Okta.Sdk/IUsersClient.cs b/src/Okta.Sdk/IUsersClient.cs index 2c5dab3fd..aaea7809a 100644 --- a/src/Okta.Sdk/IUsersClient.cs +++ b/src/Okta.Sdk/IUsersClient.cs @@ -123,5 +123,16 @@ public partial interface IUsersClient : IAsyncEnumerable /// The response. /// Explicit overload to support backward compatibility. Task UpdateUserAsync(IUser user, string userId, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Assigns a role to a user. + /// + /// The resource. + /// the user Id. + /// The flag to disable notifications. + /// The cancellation token. + /// The response. + [Obsolete("This method is deprecated and will be removed in the next major release. Use AssignRoleToUserAsync but passing a bool? param for disableNotifications instead.")] + Task AssignRoleToUserAsync(IAssignRoleRequest assignRoleRequest, string userId, string disableNotifications, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/Okta.Sdk/Internal/IHttpRequestMessageProvider.cs b/src/Okta.Sdk/Internal/IHttpRequestMessageProvider.cs index f1c632e2e..3095e37ca 100644 --- a/src/Okta.Sdk/Internal/IHttpRequestMessageProvider.cs +++ b/src/Okta.Sdk/Internal/IHttpRequestMessageProvider.cs @@ -1,4 +1,4 @@ -// +// // 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. // @@ -7,8 +7,17 @@ namespace Okta.Sdk.Internal { + /// + /// This interface is responsible for creating the corresponding request message. + /// public interface IHttpRequestMessageProvider { + /// + /// Creates an HttpRequestMessage instance. + /// + /// The request. + /// The relative path. + /// An HttpRequestMessage instance HttpRequestMessage CreateHttpRequestMessage(HttpRequest request, string relativePath); } } diff --git a/src/Okta.Sdk/Internal/MultipartFormDataPayloadHandler.cs b/src/Okta.Sdk/Internal/MultipartFormDataPayloadHandler.cs new file mode 100644 index 000000000..0ac5c28bc --- /dev/null +++ b/src/Okta.Sdk/Internal/MultipartFormDataPayloadHandler.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.IO; +using System.Net.Http; +using System.Text; + +namespace Okta.Sdk.Internal +{ + /// + public class MultipartFormDataPayloadHandler : PayloadHandler + { + /// + /// Initializes a new instance of the class. + /// + public MultipartFormDataPayloadHandler() + { + ContentType = "multipart/form-data"; + } + + /// + protected override HttpContent GetRequestHttpContent(HttpRequest httpRequest) + { + ValidateRequest(httpRequest); + + if (httpRequest.Payload == null) + { + throw new ArgumentNullException("request payload"); + } + + if (httpRequest.Payload.GetType() != typeof(byte[])) + { + throw new InvalidOperationException($"request payload should be of type , but byte[] was {httpRequest.Payload.GetType().FullName}"); + } + + var fileBytes = (byte[])httpRequest.Payload; + MultipartFormDataContent content = new MultipartFormDataContent(); + content.Add(new ByteArrayContent(fileBytes, 0, fileBytes.Length), "file", ((MultipartHttpRequest)httpRequest).FileName); + + return content; + } + } +} diff --git a/src/Okta.Sdk/Internal/PemFilePayloadHandler.cs b/src/Okta.Sdk/Internal/PemFilePayloadHandler.cs index 06fe1fc67..c8a63eaa7 100644 --- a/src/Okta.Sdk/Internal/PemFilePayloadHandler.cs +++ b/src/Okta.Sdk/Internal/PemFilePayloadHandler.cs @@ -8,7 +8,9 @@ namespace Okta.Sdk.Internal /// public class PemFilePayloadHandler : ByteArrayPayloadHandler { - /// + /// + /// Initializes a new instance of the class. + /// public PemFilePayloadHandler() { ContentType = "application/x-pem-file"; diff --git a/src/Okta.Sdk/MultipartHttpRequest.cs b/src/Okta.Sdk/MultipartHttpRequest.cs new file mode 100644 index 000000000..fab21c582 --- /dev/null +++ b/src/Okta.Sdk/MultipartHttpRequest.cs @@ -0,0 +1,18 @@ +// +// 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. +// + +namespace Okta.Sdk +{ + /// + /// This class represents a Multipart request. + /// + public class MultipartHttpRequest : HttpRequest + { + /// + /// Gets or sets the file name. + /// + public string FileName { get; set; } + } +} diff --git a/src/Okta.Sdk/Okta.Sdk.csproj b/src/Okta.Sdk/Okta.Sdk.csproj index 621afba96..11b2299bb 100644 --- a/src/Okta.Sdk/Okta.Sdk.csproj +++ b/src/Okta.Sdk/Okta.Sdk.csproj @@ -2,7 +2,7 @@ netstandard2.0;netstandard2.1;netcoreapp3.1 - 5.2.2 + 5.3.0 7.3 diff --git a/src/Okta.Sdk/OktaClient.cs b/src/Okta.Sdk/OktaClient.cs index a31f2cf6f..0aefcc001 100644 --- a/src/Okta.Sdk/OktaClient.cs +++ b/src/Okta.Sdk/OktaClient.cs @@ -77,6 +77,7 @@ protected OktaClient(OktaClientConfiguration apiClientConfiguration, IOAuthToken PayloadHandler.TryRegister(); PayloadHandler.TryRegister(); PayloadHandler.TryRegister(); + PayloadHandler.TryRegister(); } /// @@ -178,6 +179,9 @@ private static OktaClientConfiguration GetConfigurationOrDefault(OktaClientConfi public IOktaClient CreateScoped(RequestContext requestContext) => new OktaClient(_dataStore, Configuration, requestContext); + /// + public IBrandsClient Brands => new BrandsClient(_dataStore, Configuration, _requestContext); + /// public IGroupSchemasClient GroupSchemas => new GroupSchemasClient(_dataStore, Configuration, _requestContext); diff --git a/src/Okta.Sdk/OrgSetting.cs b/src/Okta.Sdk/OrgSetting.cs new file mode 100644 index 000000000..91663af34 --- /dev/null +++ b/src/Okta.Sdk/OrgSetting.cs @@ -0,0 +1,19 @@ +// +// 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.IO; +using System.Threading; +using System.Threading.Tasks; + +namespace Okta.Sdk +{ + /// + public partial class OrgSetting : IOrgSetting + { + /// + public Task UpdateOrgLogoAsync(FileStream file, CancellationToken cancellationToken = default) + => GetClient().Orgs.UpdateOrgLogoAsync(file, cancellationToken); + } +} diff --git a/src/Okta.Sdk/OrgsClient.cs b/src/Okta.Sdk/OrgsClient.cs new file mode 100644 index 000000000..c1942089c --- /dev/null +++ b/src/Okta.Sdk/OrgsClient.cs @@ -0,0 +1,33 @@ +// +// 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.IO; +using System.Threading; +using System.Threading.Tasks; + +namespace Okta.Sdk +{ + /// + public partial class OrgsClient : IOrgsClient + { + /// + public async Task UpdateOrgLogoAsync(FileStream file, CancellationToken cancellationToken = default) + { + byte[] fileBytes = new byte[file.Length]; + await file.ReadAsync(fileBytes, 0, (int)file.Length, cancellationToken).ConfigureAwait(false); + + var request = new MultipartHttpRequest + { + Uri = "/api/v1/org/logo", + Payload = fileBytes, + ContentType = "multipart/form-data", + Verb = HttpVerb.Post, + FileName = file.Name, + }; + + await PostAsync(request, cancellationToken).ConfigureAwait(false); + } + } +} diff --git a/src/Okta.Sdk/PoliciesClient.cs b/src/Okta.Sdk/PoliciesClient.cs index dcd51921e..d4a176614 100644 --- a/src/Okta.Sdk/PoliciesClient.cs +++ b/src/Okta.Sdk/PoliciesClient.cs @@ -160,6 +160,5 @@ public async Task AddPolicyRuleAsync(AddSignOnPolicyRuleO return await AddPolicyRuleAsync(policyRule, options.PolicyId, cancellationToken).ConfigureAwait(false); } - } } diff --git a/src/Okta.Sdk/Policy.cs b/src/Okta.Sdk/Policy.cs index 0ab33699a..45663baad 100644 --- a/src/Okta.Sdk/Policy.cs +++ b/src/Okta.Sdk/Policy.cs @@ -8,6 +8,7 @@ namespace Okta.Sdk { + /// public partial class Policy { /// diff --git a/src/Okta.Sdk/Theme.cs b/src/Okta.Sdk/Theme.cs new file mode 100644 index 000000000..27520c636 --- /dev/null +++ b/src/Okta.Sdk/Theme.cs @@ -0,0 +1,30 @@ +// +// 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.IO; +using System.Threading; +using System.Threading.Tasks; +using Okta.Sdk.Internal; + +namespace Okta.Sdk +{ + /// + public partial class Theme + { + /// + public Task UploadBrandThemeLogoAsync(FileStream file, string brandId, string themeId, CancellationToken cancellationToken = default) + => GetClient().Brands.UploadBrandThemeLogoAsync(file, brandId, themeId, cancellationToken); + + /// + public Task UpdateBrandThemeFaviconAsync(FileStream file, string brandId, string themeId, CancellationToken cancellationToken = default) + => GetClient().Brands.UploadBrandThemeFaviconAsync(file, brandId, themeId, cancellationToken); + + /// + public Task UpdateBrandThemeBackgroundImageAsync(FileStream file, string brandId, string themeId, CancellationToken cancellationToken = default) + => GetClient().Brands.UploadBrandThemeBackgroundImageAsync(file, brandId, themeId, cancellationToken); + } +} diff --git a/src/Okta.Sdk/User.cs b/src/Okta.Sdk/User.cs index d4139078e..2085d939f 100644 --- a/src/Okta.Sdk/User.cs +++ b/src/Okta.Sdk/User.cs @@ -13,7 +13,7 @@ namespace Okta.Sdk /// /// Represents a User resource in the Okta API. /// - public sealed partial class User : IUser + public sealed partial class User { /// public IAsyncEnumerable AppLinks diff --git a/src/Okta.Sdk/UsersClient.cs b/src/Okta.Sdk/UsersClient.cs index 2e4200875..6f6e81ea0 100644 --- a/src/Okta.Sdk/UsersClient.cs +++ b/src/Okta.Sdk/UsersClient.cs @@ -211,5 +211,10 @@ public Task DeactivateOrDeleteUserAsync(string userId) /// public Task UpdateUserAsync(IUser user, string userId, CancellationToken cancellationToken = default) => UpdateUserAsync(user, userId, null, cancellationToken); + + /// + public Task AssignRoleToUserAsync(IAssignRoleRequest assignRoleRequest, string userId, + string disableNotifications, CancellationToken cancellationToken = default(CancellationToken)) + => AssignRoleToUserAsync(assignRoleRequest, userId, (bool?)null, cancellationToken); } }